GPT-5.6 Sol · RL

R04 · RL adapt

Valid

LFM2-1.2B model adapt GRPO 2dev · Model Adaptation

1.49×PERFORMANCE RATIO
201TOOL EVENTS
4TEXT PATCHES
0BINARY NAMES

01 / PROCESS MAP

Tool activity

Each row shows one agent’s tool events in its own recorded order. Colors show broad activities; bar widths do not represent duration.

Main agentGPT-5.6 Sol · 201 visible calls

InspectEditValidateExecuteBuildProfileRollbackOther
142Inspect
9Edit
4Build
27Validate
1Execute
18Other

02 / EVENT SEQUENCE

Event timeline

Requests are grouped by agent, activity and topic. Delegations open into child branches. Summaries describe visible requests; tool errors and missing responses are flagged. A recorded response does not establish command success or a performance improvement.

Show event timelineHide event timeline141 groups · 201 calls

Scroll within this panel to view all events. Command sketches retain familiar programs and options. Values become <val> or <n>; paths, addresses and script bodies are hidden as <path>, <url> and <script>.

Main agent

  1. Inspect · Task requirements

    Requested environment setup or inspection and file and log inspection related to task requirements.

    1 call · #0001–#0001

    printenv <vars>sed -n <val> <path>
  2. Inspect · Source & workspace

    Requested environment setup or inspection and source searches related to source & workspace.

    1 call · #0002–#0002

    envrg <val>sort
  3. Inspect · Reward & policy updates

    Requested file and log inspection related to reward & policy updates.

    1 call · #0003–#0003

    sed -n <val> <path>
  4. Inspect · Source & workspace

    Requested repository inspection, source searches and file and log inspection related to source & workspace.

    4 calls · #0004–#0007

    git status --shortgit rev-parse <flag> <args>rg -n <val> <path> <path> -g <path>head -n <n>rg -n <val> <val> -g <path>rg -n <val> <val> <val> -g <path> -g <val> -g <val>
  5. Inspect · Benchmark & validation setup

    Requested file and log inspection related to benchmark & validation setup.

    1 call · #0008–#0008

    sed -n <val> <path>
  6. Inspect · Source & workspace

    Requested workspace inspection, file and log inspection and environment setup or inspection related to source & workspace.

    1 call · #0009–#0009

    find <val> -maxdepth <n> -type <val> <flag> <args>sortfind <path> -maxdepth <n> -type <val> <flag> <args>head -n <n>envrg <val>
  7. Inspect · Device memory

    Requested workspace inspection, runtime inspection and file and log inspection related to device memory.

    1 call · #0010–#0010

    find <val> -maxdepth <n> -type <val> <flag> <args>sortps <flag> <args>head -n <n>npu-smi info <n> > <path>
  8. Inspect · Benchmark & validation setup

    Requested file and log inspection related to benchmark & validation setup.

    1 call · #0011–#0011

    tail -n <n> <path>
  9. Inspect · Checkpoints & weight state

    Requested source searches and file and log inspection related to checkpoints & weight state.

    1 call · #0012–#0012

    rg -n <val> <path>sed -n <val>
  10. Inspect · Source & workspace

    1 tool error

    Requested file and log inspection and script or workload execution related to source & workspace.

    1 call · #0013–#0013

    jq <path> <path>python3 - <script>
  11. Inspect · Benchmark & validation setup

    Requested file and log inspection and workspace inspection related to benchmark & validation setup.

    1 call · #0014–#0014

    tail -n <n> <path>find <val> -path <path> -type <val> <flag> <args>sort <flag>head -n <n>
  12. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0015–#0016

    sed -n <val> <path>
  13. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0017–#0017

    sed -n <val> <path>
  14. Inspect · Convolution & sequence boundaries

    Requested source searches and file and log inspection related to convolution & sequence boundaries.

    1 call · #0018–#0018

    rg -n <val> <val> <val> -g <path> -g <val> -g <val> -g <val>sed -n <val>
  15. Inspect · Source & workspace

    Requested repository inspection related to source & workspace.

    3 calls · #0019–#0021

    git log <flag> <args>
  16. Inspect · Attention kernels

    Requested repository inspection related to attention kernels.

    1 call · #0022–#0022

    git log <flag> <args>
  17. Validate · Device memory

    Requested file and log inspection and runtime inspection related to device memory.

    1 call · #0023–#0023

    tail -n <n> <path>npu-smi info <n> > <path>tail -n <n>
  18. Inspect · Benchmark & validation setup

    Requested file and log inspection, runtime inspection and workspace inspection related to benchmark & validation setup.

    2 calls · #0024–#0025

    tail -n <n> <path>sed -n <path>ps <flag> <args>head -n <n>stat -c <val> <path>rg -v <val>
    1 more command sketches
    tail -n <n>
  19. Other · Benchmark & validation setup

    1 tool error

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0026–#0026

    bash <script>
  20. Inspect · KV-cache management

    1 tool error

    Requested file and log inspection and source searches related to kv-cache management.

    4 calls · #0027–#0030

    sed -n <val> <path>rg -n <val> <path> <path> -g <path>head -n <n>rg -n <val> <path>rg -n <val> <path> -g <path> <path> -g <path>
  21. Inspect · Attention kernels

    Requested source searches, file and log inspection and workspace inspection related to attention kernels.

    1 call · #0031–#0031

    rg -n <val> <val> -g <path>head -n <n>find <val> -iname <val> -o -iname <val>sort
  22. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0032–#0032

    Apply patch <patch>
  23. Inspect · Source & workspace

    Requested runtime inspection, source searches and repository inspection related to source & workspace.

    2 calls · #0033–#0034

    ps <flag> <args>rg <val>rg -v <val>git diff <flag> <args><command> <args>head -n <n>
  24. Inspect · Device memory

    Requested runtime inspection, file and log inspection and repository inspection related to device memory.

    1 call · #0035–#0035

    ps -p <n> -o <val>truenpu-smi info <n> > <path>tail -n <n>git status --short
  25. Other · Prefix caching

    Requested script or workload execution related to prefix caching.

    1 call · #0036–#0036

    python3 - <script>
  26. Other · Source & workspace

    Requested execution waits and runtime inspection related to source & workspace.

    1 call · #0037–#0037

    <command> <args>sleep <n>ps -p <n> -o <val>true
  27. Inspect · Benchmark & validation setup

    Requested workspace inspection, file and log inspection and source searches related to benchmark & validation setup.

    1 call · #0038–#0038

    stat -c <val> <path>tail -n <n> <path>rg -v <val>tail -n <n>
  28. Inspect · Convolution & sequence boundaries

    Requested file and log inspection related to convolution & sequence boundaries.

    1 call · #0039–#0039

    sed -n <val> <path>
  29. Validate · Device memory

    Requested file and log inspection, source searches and workspace inspection related to device memory.

    1 call · #0040–#0040

    tail -n <n> <path>rg -v <val>tail -n <n>stat -c <val> <path>npu-smi info <n> > <path>
  30. Inspect · Benchmark & validation setup

    Requested file and log inspection, source searches and workspace inspection related to benchmark & validation setup.

    1 call · #0041–#0041

    tail -n <n> <path>rg -v <val>tail -n <n>stat -c <val> <path>
  31. Inspect · Device memory

    Requested file and log inspection, source searches and workspace inspection related to device memory.

    3 calls · #0042–#0044

    tail -n <n> <path>rg <val>tail -n <n>stat -c <val> <path>ps <flag> <args>head -n <n>
  32. Validate · Device memory

    Requested file and log inspection, source searches and workspace inspection related to device memory.

    1 call · #0045–#0045

    tail -n <n> <path>rg <val>tail -n <n>stat -c <val> <path>npu-smi info <n> > <path>
  33. Inspect · Benchmark & validation setup

    Requested file and log inspection and workspace inspection related to benchmark & validation setup.

    1 call · #0046–#0046

    tail -n <n> <path>stat -c <val> <path>
  34. Validate · Device memory

    Requested runtime inspection, file and log inspection and workspace inspection related to device memory.

    1 call · #0047–#0047

    ps <flag> <args>head -n <n>npu-smi info <n> > <path>stat -c <val> <path>
  35. Inspect · Benchmark & validation setup

    Requested file and log inspection, runtime inspection and source searches related to benchmark & validation setup.

    1 call · #0048–#0048

    tail -n <n> <path>ps <flag> <args>rg <val>head -n <n>
  36. Validate · Benchmark & validation setup

    Requested file and log inspection, workspace inspection and runtime inspection related to benchmark & validation setup.

    1 call · #0049–#0049

    tail -n <n> <path>stat -c <val> <path>ps -p <n> -o <val>true
  37. Inspect · Checkpoints & weight state

    Requested file and log inspection, source searches and workspace inspection related to checkpoints & weight state.

    1 call · #0050–#0050

    tail -n <n> <path>rg <val>tail -n <n>stat -c <val> <path>find <path> -maxdepth <n> -type <val> <flag> <args>head -n <n>
  38. Other · Benchmark & validation setup

    1 tool error

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0051–#0051

    bash <script>
  39. Inspect · Benchmark & validation setup

    Requested workspace inspection and file and log inspection related to benchmark & validation setup.

    1 call · #0052–#0052

    ls -l -h <val>jq <path> <path>sed -n <val> <path>
  40. Validate · Reward & policy updates

    Requested script or workload execution, source searches and file and log inspection related to reward & policy updates.

    1 call · #0053–#0053

    python - <script>rg -n <val> <path> <path> <path>head -n <n>
  41. Validate · Benchmark & validation setup

    Requested script or workload execution, workspace inspection and file and log inspection related to benchmark & validation setup.

    1 call · #0054–#0054

    python - <script>find <path> -maxdepth <n> -type <val> <val> -iname <path> -o -iname <path> <args>sorthead -n <n>rg -n <val> <path> <path>
  42. Validate · Reward & policy updates

    Requested script or workload execution, file and log inspection and source searches related to reward & policy updates.

    2 calls · #0055–#0056

    python - <script>sed -n <val> <path>rg -n <val> <path> -g <path>head -n <n>find <path> -type <val> -path <val>sort
  43. Inspect · Task requirements

    Requested file and log inspection related to task requirements.

    1 call · #0057–#0057

    sed -n <val> <path>
  44. Inspect · Reward & policy updates

    Requested source searches and file and log inspection related to reward & policy updates.

    1 call · #0058–#0058

    rg -n <val> <path>head -n <n>sed -n <val> <path>rg -n <val> <path> -g <path>
  45. Inspect · Source & workspace

    Requested file and log inspection and source searches related to source & workspace.

    3 calls · #0059–#0061

    sed -n <val> <path>rg -n <val> <path> <path> -g <path>head -n <n>rg -n <val> <path>
  46. Inspect · Attention kernels

    Requested source searches and file and log inspection related to attention kernels.

    2 calls · #0062–#0063

    rg -n <val> <path> <path>head -n <n>sed -n <val> <path>rg -n <val> <path> <path> -g <path>rg -n <val> <path>tail -n <n>
  47. Inspect · Source & workspace

    Requested file and log inspection and source searches related to source & workspace.

    1 call · #0064–#0064

    sed -n <val> <path>rg -n <val> <path> -g <path>rg -n <val> <path>head -n <n>
  48. Inspect · Runtime processes

    Requested file and log inspection and source searches related to runtime processes.

    1 call · #0065–#0065

    sed -n <val> <path>sed -n <val> <path> <n> > <path>head -n <n>rg -n <val> <path> -g <path>rg -n <val> <path>
  49. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    5 calls · #0066–#0070

    rg -n <val> <path> -g <path>sed -n <val> <path> <n> > <path>sed -n <val> <path>rg -n <val> <path> -C <n>rg -n <val> <path>rg -n <val> <path> <path> -g <path>
    1 more command sketches
    head -n <n>
  50. Validate · Reward & policy updates

    Requested file and log inspection, source searches and script or workload execution related to reward & policy updates.

    2 calls · #0071–#0072

    jq <val> <path>rg -n <val> <path> <path>python - <script>sed -n <val> <path>rg -n <val> <path> <path> <path> -g <val> -g <path>head -n <n>
  51. Inspect · Reward & policy updates

    Requested source searches and file and log inspection related to reward & policy updates.

    2 calls · #0073–#0074

    rg -n <val> <path> <path> -g <path>head -n <n>sed -n <val> <path>rg -n <val> <path> -g <val>
  52. Inspect · Source & workspace

    Requested file and log inspection and source searches related to source & workspace.

    1 call · #0075–#0075

    head -n <n> <path>rg -n <val> <path> <path> <path> <path> -g <path> -g <val>head -n <n>
  53. Edit · Reward & policy updates

    Requested code edits related to reward & policy updates.

    1 call · #0076–#0076

    Apply patch <patch>
  54. Other · Reward & policy updates

    Requested repository inspection and file and log inspection related to reward & policy updates.

    1 call · #0077–#0077

    git -C <path> <val> <flag> <args>sed -n <val> <path>
  55. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0078–#0078

    Apply patch <patch>
  56. Inspect · Source & workspace

    Requested source searches and file and log inspection related to source & workspace.

    1 call · #0079–#0079

    rg -n <val> <val> <val> -g <path> -g <val>head -n <n>rg -n <val> <path>sed -n <val> <val>
  57. Other · Source & workspace

    1 tool error

    Requested script or workload execution related to source & workspace.

    1 call · #0080–#0080

    python <script> --files <script> <flag>
  58. Inspect · Dependencies & build setup

    Requested script or workload execution, workspace inspection and file and log inspection related to dependencies & build setup.

    1 call · #0081–#0081

    command -v <val>python -V<command> <args>truefind <path> -type <val> -name <val> <n> > <path>head -n <n>
    1 more command sketches
    python -m <module> <val> <val> <n> > <path>
  59. Build · Dependencies & build setup

    Requested script or workload execution related to dependencies & build setup.

    1 call · #0082–#0082

    python -m <module> <val> <val>
  60. Inspect · Convolution & sequence boundaries

    Requested repository inspection, file and log inspection and source searches related to convolution & sequence boundaries.

    1 call · #0083–#0083

    git status --shortgit diff --statgit diff <flag> <args>head -n <n>rg -n <val> <path> <path>
  61. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    2 calls · #0084–#0085

    python <script> --files <script> <flag><command> <args>
  62. Inspect · Convolution & sequence boundaries

    Requested repository inspection, source searches and workspace inspection related to convolution & sequence boundaries.

    1 call · #0086–#0086

    git status --shortgit diff --statrg -n <val> <path> <path>find <path> -maxdepth <n> -name <val> <flag>
  63. Inspect · Source & workspace

    Requested workspace inspection, file and log inspection and runtime inspection related to source & workspace.

    3 calls · #0087–#0089

    ls -l <path>head -n <n> <path>ps <flag>rg <val>rg -v <val>true
    7 more command sketches
    python <script> --helpsed -n <val> <path>find <path> -maxdepth <n> -type <val> -name <val> -o -name <val>head -n <n>command -v <val><command> <args>find <path> -maxdepth <n> -type <val> -name <val> <flag>
  64. Inspect · Dependencies & build setup

    Requested source searches and file and log inspection related to dependencies & build setup.

    1 call · #0090–#0090

    rg -n <val> <val> <path> <val>head -n <n>rg -n <val> <path> <val> <val>
  65. Build · Dependencies & build setup

    Requested script or workload execution related to dependencies & build setup.

    1 call · #0091–#0091

    python -m <module> <val> <val>
  66. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0092–#0092

    Apply patch <patch>
  67. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0093–#0093

    python <script> --files <script> <flag> <args>
  68. Inspect · Source & workspace

    Requested repository inspection and file and log inspection related to source & workspace.

    2 calls · #0094–#0095

    git status --shortgit diff --statgit diff <flag> <args>sed -n <val>sed -n <val> <path>
  69. Inspect · Attention kernels

    Requested environment setup or inspection related to attention kernels.

    1 call · #0096–#0096

    env <vars> python - <script>env <vars> python <script> --files <script> <flag> <args>
  70. Inspect · Source & workspace

    Requested repository inspection, file and log inspection and source searches related to source & workspace.

    1 call · #0097–#0097

    git -C <path> <val> <flag> <args>sed -n <val> <path>rg -n <val> <path> <path> -g <path>head -n <n>
  71. Inspect · Attention kernels

    Requested source searches and file and log inspection related to attention kernels.

    1 call · #0098–#0098

    rg -n <val> <path> -g <path>head -n <n>sed -n <val> <path>
  72. Inspect · KV-cache management

    Requested file and log inspection, source searches and repository inspection related to kv-cache management.

    2 calls · #0099–#0100

    sed -n <val> <path>rg -n <val> <flag> <args>git -C <path> <val> --oneline <flag> <args>git -C <path> <val> -p <flag> <args>head -n <n>rg -n <val> <path>
  73. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0101–#0101

    sed -n <val> <path>jq <val> <path>
  74. Validate · Reward & policy updates

    Requested environment setup or inspection related to reward & policy updates.

    1 call · #0102–#0102

    env <vars> python -m <module> -q <script>
  75. Other · Reward & policy updates

    1 tool error

    Requested environment setup or inspection related to reward & policy updates.

    1 call · #0103–#0103

    env <vars> python - <script>
  76. Inspect · Source & workspace

    Requested runtime inspection and source searches related to source & workspace.

    1 call · #0104–#0104

    ps <flag>rg <val>rg -v <val>true
  77. Inspect · Task requirements

    Requested file and log inspection and workspace inspection related to task requirements.

    3 calls · #0105–#0107

    sed -n <val> <path>find <path> -name <val> -o -name <val>head -n <n>wc -l <path> <path> <path>
  78. Other · Source & workspace

    1 tool error

    Requested script or workload execution related to source & workspace.

    1 call · #0108–#0108

    bash <script>
  79. Inspect · Source & workspace

    Requested repository inspection, file and log inspection and workspace inspection related to source & workspace.

    2 calls · #0109–#0110

    git status --shortgit diff --statgit diff <flag> <args>head -n <n>git diff --checkfind <path> -maxdepth <n> -type <val> <flag> <args>
    2 more command sketches
    find <path> -maxdepth <n> -type <val> <flag>find <path> <path> <path> -maxdepth <n> -type <val> -name <val> <flag>
  80. Inspect · Reward & policy updates

    Requested repository inspection and file and log inspection related to reward & policy updates.

    1 call · #0111–#0111

    git diff <flag> <args>tail -n <n>sed -n <val> <path>
  81. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0112–#0112

    Apply patch <patch>
  82. Inspect · Source & workspace

    Requested workspace inspection and file and log inspection related to source & workspace.

    1 call · #0113–#0113

    ls -l -t <val>head -n <n>find <val> -maxdepth <n> -type <val> <flag> <args>sort
  83. Inspect · Benchmark & validation setup

    Requested file and log inspection, source searches and workspace inspection related to benchmark & validation setup.

    8 calls · #0114–#0121

    tail -n <n> <path>sed -n <path>printf <val>rg -c <val> <path>ls -l -t <val>head -n <n>
    2 more command sketches
    find <val> -maxdepth <n> -type <val> <flag> <args>sort
  84. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    3 calls · #0122–#0124

    tail -n <n> <path>
  85. Other · Benchmark & validation setup

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0125–#0125

    bash <script>
  86. Inspect · Checkpoints & weight state

    Requested file and log inspection related to checkpoints & weight state.

    1 call · #0126–#0126

    jq -r <path> <path>jq <val> <path>
  87. Validate · Benchmark & validation setup

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0127–#0127

    python - <script>
  88. Inspect · Task requirements

    Requested file and log inspection related to task requirements.

    1 call · #0128–#0128

    printf <val> <val> <val>sed -n <val> <path>
  89. Inspect · Checkpoints & weight state

    Requested source searches and file and log inspection related to checkpoints & weight state.

    1 call · #0129–#0129

    rg -n <val> <path> <path> <path>head -n <n>
  90. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0130–#0130

    sed -n <val> <path>
  91. Inspect · Checkpoints & weight state

    Requested source searches and file and log inspection related to checkpoints & weight state.

    3 calls · #0131–#0133

    rg -n <val> <path> <path> <path> <path>head -n <n>sed -n <val> <path>grep -v -E <val>
  92. Inspect · Rollout generation

    Requested file and log inspection related to rollout generation.

    1 call · #0134–#0134

    sed -n <val> <path>
  93. Inspect · Device memory

    Requested source searches and file and log inspection related to device memory.

    2 calls · #0135–#0136

    rg -n <val> <path>head -n <n>sed -n <val> <path>rg -n <val> <path> <path> <path>
  94. Inspect · Source & workspace

    Requested workspace inspection and file and log inspection related to source & workspace.

    1 call · #0137–#0137

    find <val> -maxdepth <n> -type <val> <flag> <args>sorttail -n <n>find <path> -maxdepth <n> -type <val> <val> -name <val> -o -name <val> <args>
  95. Inspect · KV-cache management

    Requested source searches and file and log inspection related to kv-cache management.

    1 call · #0138–#0138

    rg -n <val> <path> <path>head -n <n>
  96. Inspect · Benchmark & validation setup

    Requested file and log inspection related to benchmark & validation setup.

    1 call · #0139–#0139

    sed -n <val> <path>sed -r <path>
  97. Inspect · Runtime processes

    Requested source searches and file and log inspection related to runtime processes.

    1 call · #0140–#0140

    rg -n <val> <path>head -n <n>
  98. Inspect · Rollout generation

    Requested file and log inspection and source searches related to rollout generation.

    5 calls · #0141–#0145

    sed -n <val> <path>rg -n <val> <path> --glob <path>rg -n <val> <path> <path> -g <path>rg -n <val> <path> <path> --glob <path>head -n <n>
  99. Inspect · Runtime processes

    Requested source searches and file and log inspection related to runtime processes.

    1 call · #0146–#0146

    rg -n <val> <path> --glob <path>head -n <n>
  100. Inspect · Convolution & sequence boundaries

    Requested source searches and file and log inspection related to convolution & sequence boundaries.

    1 call · #0147–#0147

    rg -n <val> <path>head -n <n>sed -n <val> <path>
  101. Edit · Rollout generation

    Requested code edits related to rollout generation.

    1 call · #0148–#0148

    Apply patch <patch>
  102. Inspect · Rollout generation

    Requested repository inspection related to rollout generation.

    1 call · #0149–#0149

    git diff <flag> <args>git -C <path> <val> <flag> <args>
  103. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0150–#0150

    python <script> --files <script> <flag> <args>
  104. Inspect · KV-cache management

    Requested file and log inspection and source searches related to kv-cache management.

    3 calls · #0151–#0153

    sed -n <val> <path>rg -n <val> <path> <path> --glob <path>head -n <n>
  105. Inspect · Rollout generation

    Requested source searches and file and log inspection related to rollout generation.

    2 calls · #0154–#0155

    rg -n <val> <path> <path> --glob <path>head -n <n>rg -n <val> <path> -g <path>sed -n <val> <path>
  106. Inspect · KV-cache management

    Requested source searches and file and log inspection related to kv-cache management.

    1 call · #0156–#0156

    rg -n <val> <path> <path> --glob <path>head -n <n>
  107. Edit · KV-cache management

    Requested code edits related to kv-cache management.

    1 call · #0157–#0157

    Apply patch <patch>
  108. Execute · Rollout generation

    Requested script or workload execution and environment setup or inspection related to rollout generation.

    1 call · #0158–#0158

    python -m <module> <script> <script> <script> <script> <script>env <vars> python - <script>
  109. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0159–#0159

    sed -n <val> <path>
  110. Other · Rollout generation

    Requested tool activity related to rollout generation.

    1 call · #0160–#0160

    <command> <args>
  111. Validate · KV-cache management

    1 tool error

    Requested script or workload execution related to kv-cache management.

    1 call · #0161–#0161

    python -m <module> -q <script>
  112. Validate · Reward & policy updates

    Requested environment setup or inspection related to reward & policy updates.

    1 call · #0162–#0162

    env <vars> python -m <module> -q <script>
  113. Build · Attention kernels

    Requested environment setup or inspection and script or workload execution related to attention kernels.

    1 call · #0163–#0163

    env <vars> python - <script>python <script> --files <script> <flag> <args>
  114. Build · Dependencies & build setup

    Requested script or workload execution related to dependencies & build setup.

    1 call · #0164–#0164

    python -m <module> <val> <val>
  115. Validate · KV-cache management

    1 tool error

    Requested script or workload execution related to kv-cache management.

    1 call · #0165–#0165

    python -m <module> -q <script>
  116. Inspect · Source & workspace

    Requested file and log inspection and source searches related to source & workspace.

    1 call · #0166–#0166

    sed -n <val> <path>rg -n <val> <path> -g <path>
  117. Inspect · KV-cache management

    Requested file and log inspection and source searches related to kv-cache management.

    1 call · #0167–#0167

    sed -n <val> <path>rg -n <val> <path> <path>
  118. Validate · Benchmark & validation setup

    1 tool error

    Requested workspace inspection, file and log inspection and script or workload execution related to benchmark & validation setup.

    2 calls · #0168–#0169

    find <val> -maxdepth <n> -type <val> -name <val> <flag> <args>sort<command> <args>sed -r <path>cut <flag>bash <script>
  119. Inspect · Benchmark & validation setup

    Requested file and log inspection related to benchmark & validation setup.

    1 call · #0170–#0170

    tail -n <n> <path>sed -r <path>cut <flag>
  120. Validate · Benchmark & validation setup

    Requested script or workload execution, source searches and file and log inspection related to benchmark & validation setup.

    1 call · #0171–#0171

    python - <script>rg -n <val> <path> <path>tail -n <n>
  121. Validate · Reward & policy updates

    Requested script or workload execution related to reward & policy updates.

    2 calls · #0172–#0173

    python - <script>
  122. Validate · Task requirements

    Requested file and log inspection and script or workload execution related to task requirements.

    1 call · #0174–#0174

    sed -n <val> <path>python - <script>
  123. Validate · Reward & policy updates

    Requested script or workload execution related to reward & policy updates.

    1 call · #0175–#0175

    python - <script>
  124. Inspect · Rollout generation

    Requested file and log inspection related to rollout generation.

    1 call · #0176–#0176

    sed -n <val> <path>
  125. Edit · Rollout generation

    Requested code edits related to rollout generation.

    1 call · #0177–#0177

    Apply patch <patch>
  126. Other · Rollout generation

    1 tool error

    Requested script or workload execution and environment setup or inspection related to rollout generation.

    2 calls · #0178–#0179

    <command> <args>python -m <module> <script> <script> <script>env <vars> python - <script>
  127. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0180–#0180

    bash <script>
  128. Validate · Benchmark & validation setup

    Requested file and log inspection related to benchmark & validation setup.

    1 call · #0181–#0181

    tail -n <n> <path> <n> > <path>sed -r <path>cut <flag>
  129. Inspect · Benchmark & validation setup

    Requested file and log inspection related to benchmark & validation setup.

    2 calls · #0182–#0183

    tail -n <n> <path>sed -r <path>cut <flag>
  130. Validate · Benchmark & validation setup

    1 tool error

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0184–#0184

    bash <script>
  131. Validate · Reward & policy updates

    Requested script or workload execution, source searches and file and log inspection related to reward & policy updates.

    1 call · #0185–#0185

    python - <script>rg -n <val> <path>tail -n <n>
  132. Inspect · Rollout generation

    Requested file and log inspection related to rollout generation.

    1 call · #0186–#0186

    sed -n <val> <path>sed -r <path>
  133. Inspect · Source & workspace

    Requested file and log inspection and source searches related to source & workspace.

    2 calls · #0187–#0188

    sed -n <val> <path>rg -n <val> <path> <path> <path> <path>head -n <n><command> <args>sed -n <val> <val>
  134. Edit · Rollout generation

    Requested code edits related to rollout generation.

    1 call · #0189–#0189

    Apply patch <patch>
  135. Inspect · Reward & policy updates

    Requested repository inspection and file and log inspection related to reward & policy updates.

    1 call · #0190–#0190

    git status --shortgit diff --checkgit diff --statgit diff <flag> <args>sed -n <val>git -C <path> <val> --short
    3 more command sketches
    git -C <path> <val> --checkgit -C <path> <val> --statgit -C <path> <val> <flag> <args>
  136. Inspect · Source & workspace

    Requested source searches, file and log inspection and environment setup or inspection related to source & workspace.

    1 call · #0191–#0191

    rg -n <val> <val> <path>head -n <n>envrg <val>true
  137. Inspect · Rollout generation

    Requested script or workload execution, repository inspection and file and log inspection related to rollout generation.

    2 calls · #0192–#0193

    <command> <args>python -m <module> <script> <script>git diff --checksed -n <val> <path>git status --shortgit diff --stat
  138. Validate · Benchmark & validation setup

    Requested file and log inspection related to benchmark & validation setup.

    1 call · #0194–#0194

    <command> <args>sed -r <path>cut <flag>
  139. Inspect · Benchmark & validation setup

    Requested file and log inspection related to benchmark & validation setup.

    4 calls · #0195–#0198

    tail -n <n> <path>sed -r <path>cut <flag>
  140. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0199–#0200

    <command> <args>sed -r <path>cut <flag>tail -n <n> <path>
  141. Other · Benchmark & validation setup

    1 missing return

    Requested script or workload execution related to benchmark & validation setup.

    1 call · #0201–#0201

    bash <script>

03 / CANDIDATE ARTIFACT

Text patches & binary names

Read code changes as Git diffs. Identifying strings are masked; binary files are listed by their full relative names.

transformers · 2 changed files

Base commit: 76b3bd40ca74d26f0c2bffaf42ed01f422fc70f6

diff --git a/src/transformers/models/lfm2/modeling_lfm2.py b/src/transformers/models/lfm2/modeling_lfm2.pyindex f9ae8deeb86523771939b52fee6531c60fac5bfa..ee32fdcb57e1e27f253c7f00beac40ac522acf2b 100644--- a/src/transformers/models/lfm2/modeling_lfm2.py+++ b/src/transformers/models/lfm2/modeling_lfm2.py@@ -453,11 +453,41 @@ class Lfm2ShortConv(nn.Module):         self.in_proj = nn.Linear(config.hidden_size, 3 * config.hidden_size, bias=self.bias)         self.out_proj = nn.Linear(config.hidden_size, config.hidden_size, bias=self.bias) +    def _remove_packed_sequence_leakage(+        self,+        conv_input: torch.Tensor,+        conv_output: torch.Tensor,+        position_ids: torch.LongTensor | None,+    ) -> torch.Tensor:+        """Remove convolution terms that cross packed-sequence boundaries.++        Padding-free training packs multiple examples into a single sequence and+        resets ``position_ids`` for every example. Attention kernels use those+        resets as sequence boundaries, but a regular depthwise convolution does+        not. Subtract the preceding-token terms for the first ``kernel_size - 1``+        positions of every packed example so the result matches independent+        causal convolutions.+        """+        if position_ids is None:+            return conv_output++        position_ids = position_ids.reshape(-1, position_ids.shape[-1])+        if position_ids.shape[0] == 1 and conv_input.shape[0] != 1:+            position_ids = position_ids.expand(conv_input.shape[0], -1)+        kernel_size = self.conv.weight.shape[-1]+        for lag in range(1, kernel_size):+            shifted_input = nn.functional.pad(conv_input, (lag, 0))[..., : conv_input.shape[-1]]+            crosses_boundary = position_ids.lt(lag).unsqueeze(1)+            kernel_weight = self.conv.weight[:, 0, kernel_size - lag - 1].view(1, -1, 1)+            conv_output = conv_output - shifted_input * crosses_boundary * kernel_weight+        return conv_output+     def cuda_kernels_forward(         self,         x: torch.Tensor,         past_key_values: Lfm2HybridConvCache | None = None,         attention_mask: torch.Tensor | None = None,+        position_ids: torch.LongTensor | None = None,     ):         x = apply_mask_to_padding_states(x, attention_mask)         BCx = self.in_proj(x).transpose(-1, -2)@@ -481,6 +511,7 @@ class Lfm2ShortConv(nn.Module):                 past_key_values.conv_cache[self.layer_idx].copy_(conv_state)              conv_out = causal_conv1d_fn(Bx, conv_weights, self.conv.bias, activation=None)+            conv_out = self._remove_packed_sequence_leakage(Bx, conv_out, position_ids)          y = C * conv_out         y = self.out_proj(y.transpose(-1, -2).contiguous())@@ -491,6 +522,7 @@ class Lfm2ShortConv(nn.Module):         x: torch.Tensor,         past_key_values: Lfm2HybridConvCache | None = None,         attention_mask: torch.Tensor | None = None,+        position_ids: torch.LongTensor | None = None,     ):         seqlen = x.shape[1] @@ -525,6 +557,7 @@ class Lfm2ShortConv(nn.Module):                 past_key_values.conv_cache[self.layer_idx].copy_(conv_state)              conv_out = self.conv(Bx)[..., :seqlen]+            conv_out = self._remove_packed_sequence_leakage(Bx, conv_out, position_ids)          y = C * conv_out         y = y.transpose(-1, -2).contiguous()@@ -536,10 +569,11 @@ class Lfm2ShortConv(nn.Module):         hidden_states: torch.Tensor,         past_key_values: Lfm2HybridConvCache | None = None,         attention_mask: torch.Tensor | None = None,+        position_ids: torch.LongTensor | None = None,     ):         if is_fast_path_available and "cuda" in hidden_states.device.type and not is_torchdynamo_compiling():-            return self.cuda_kernels_forward(hidden_states, past_key_values, attention_mask)-        return self.slow_forward(hidden_states, past_key_values, attention_mask)+            return self.cuda_kernels_forward(hidden_states, past_key_values, attention_mask, position_ids)+        return self.slow_forward(hidden_states, past_key_values, attention_mask, position_ids)   class Lfm2DecoderLayer(GradientCheckpointingLayer):@@ -579,6 +613,7 @@ class Lfm2DecoderLayer(GradientCheckpointingLayer):                 hidden_states=self.operator_norm(hidden_states),                 past_key_values=past_key_values,                 attention_mask=attention_mask,+                position_ids=position_ids,             )         hidden_states = hidden_states + residual         hidden_states = hidden_states + self.feed_forward(self.ffn_norm(hidden_states))diff --git a/src/transformers/models/lfm2/modular_lfm2.py b/src/transformers/models/lfm2/modular_lfm2.pyindex eab687df803a274d1a9e0d137e1b802abf9d4dbb..ddde08270cde20d08ed4bbaf337fc5e60feb00d9 100644--- a/src/transformers/models/lfm2/modular_lfm2.py+++ b/src/transformers/models/lfm2/modular_lfm2.py@@ -288,11 +288,41 @@ class Lfm2ShortConv(nn.Module):         self.in_proj = nn.Linear(config.hidden_size, 3 * config.hidden_size, bias=self.bias)         self.out_proj = nn.Linear(config.hidden_size, config.hidden_size, bias=self.bias) +    def _remove_packed_sequence_leakage(+        self,+        conv_input: torch.Tensor,+        conv_output: torch.Tensor,+        position_ids: torch.LongTensor | None,+    ) -> torch.Tensor:+        """Remove convolution terms that cross packed-sequence boundaries.++        Padding-free training packs multiple examples into a single sequence and+        resets ``position_ids`` for every example. Attention kernels use those+        resets as sequence boundaries, but a regular depthwise convolution does+        not. Subtract the preceding-token terms for the first ``kernel_size - 1``+        positions of every packed example so the result matches independent+        causal convolutions.+        """+        if position_ids is None:+            return conv_output++        position_ids = position_ids.reshape(-1, position_ids.shape[-1])+        if position_ids.shape[0] == 1 and conv_input.shape[0] != 1:+            position_ids = position_ids.expand(conv_input.shape[0], -1)+        kernel_size = self.conv.weight.shape[-1]+        for lag in range(1, kernel_size):+            shifted_input = nn.functional.pad(conv_input, (lag, 0))[..., : conv_input.shape[-1]]+            crosses_boundary = position_ids.lt(lag).unsqueeze(1)+            kernel_weight = self.conv.weight[:, 0, kernel_size - lag - 1].view(1, -1, 1)+            conv_output = conv_output - shifted_input * crosses_boundary * kernel_weight+        return conv_output+     def cuda_kernels_forward(         self,         x: torch.Tensor,         past_key_values: Lfm2HybridConvCache | None = None,         attention_mask: torch.Tensor | None = None,+        position_ids: torch.LongTensor | None = None,     ):         x = apply_mask_to_padding_states(x, attention_mask)         BCx = self.in_proj(x).transpose(-1, -2)@@ -316,6 +346,7 @@ class Lfm2ShortConv(nn.Module):                 past_key_values.conv_cache[self.layer_idx].copy_(conv_state)              conv_out = causal_conv1d_fn(Bx, conv_weights, self.conv.bias, activation=None)+            conv_out = self._remove_packed_sequence_leakage(Bx, conv_out, position_ids)          y = C * conv_out         y = self.out_proj(y.transpose(-1, -2).contiguous())@@ -326,6 +357,7 @@ class Lfm2ShortConv(nn.Module):         x: torch.Tensor,         past_key_values: Lfm2HybridConvCache | None = None,         attention_mask: torch.Tensor | None = None,+        position_ids: torch.LongTensor | None = None,     ):         seqlen = x.shape[1] @@ -360,6 +392,7 @@ class Lfm2ShortConv(nn.Module):                 past_key_values.conv_cache[self.layer_idx].copy_(conv_state)              conv_out = self.conv(Bx)[..., :seqlen]+            conv_out = self._remove_packed_sequence_leakage(Bx, conv_out, position_ids)          y = C * conv_out         y = y.transpose(-1, -2).contiguous()@@ -371,10 +404,11 @@ class Lfm2ShortConv(nn.Module):         hidden_states: torch.Tensor,         past_key_values: Lfm2HybridConvCache | None = None,         attention_mask: torch.Tensor | None = None,+        position_ids: torch.LongTensor | None = None,     ):         if is_fast_path_available and "cuda" in hidden_states.device.type and not is_torchdynamo_compiling():-            return self.cuda_kernels_forward(hidden_states, past_key_values, attention_mask)-        return self.slow_forward(hidden_states, past_key_values, attention_mask)+            return self.cuda_kernels_forward(hidden_states, past_key_values, attention_mask, position_ids)+        return self.slow_forward(hidden_states, past_key_values, attention_mask, position_ids)   class Lfm2DecoderLayer(GradientCheckpointingLayer):@@ -414,6 +448,7 @@ class Lfm2DecoderLayer(GradientCheckpointingLayer):                 hidden_states=self.operator_norm(hidden_states),                 past_key_values=past_key_values,                 attention_mask=attention_mask,+                position_ids=position_ids,             )         hidden_states = hidden_states + residual         hidden_states = hidden_states + self.feed_forward(self.ffn_norm(hidden_states))
verl · 9 changed files

Base commit: 0b2151ec61de5d99e0811b01c09e43a99a23e69d

diff --git a/verl/rollout_load_balancer.py b/verl/rollout_load_balancer.pynew file mode 100644index 0000000000000000000000000000000000000000..4128be8d10f5fa99cb747cff5a571e05d88ca6e3--- /dev/null+++ b/verl/rollout_load_balancer.py@@ -0,0 +1,95 @@+# Copyright 2024 Bytedance Ltd. and/or its affiliates+#+# Licensed under the Apache License, Version 2.0 (the "License");+# you may not use this file except in compliance with the License.+# You may obtain a copy of the License at+#+#     http://www.apache.org/licenses/LICENSE-2.0+#+# Unless required by applicable law or agreed to in writing, software+# distributed under the License is distributed on an "AS IS" BASIS,+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+# See the License for the specific language governing permissions and+# limitations under the License.+"""Dependency-light global request routing for rollout servers."""++import logging+import os++import ray+from cachetools import LRUCache++logger = logging.getLogger(__file__)+logger.setLevel(os.getenv("VERL_LOGGING_LEVEL", "WARN"))++DEFAULT_ROUTING_CACHE_SIZE = 10000+++@ray.remote+class GlobalRequestLoadBalancer:+    """Global sticky-session and in-flight load balancer.++    Keeping this actor in a small module prevents each router process from+    importing the rollout engines and their accelerator plugins.+    """++    def __init__(self, servers: dict[str, ray.actor.ActorHandle], max_cache_size: int = DEFAULT_ROUTING_CACHE_SIZE):+        if not servers:+            raise ValueError("servers must be non-empty")++        self._servers: dict[str, ray.actor.ActorHandle] = dict(servers)+        self._inflight_requests: dict[str, int] = {sid: 0 for sid in servers}+        self._request_id_to_server: LRUCache = LRUCache(maxsize=max_cache_size)++    def acquire_server(self, request_id: str) -> tuple[str, ray.actor.ActorHandle]:+        """Acquire a server for a request using sticky, least-loaded routing."""+        if request_id in self._request_id_to_server:+            server_id = self._request_id_to_server[request_id]+            if server_id in self._inflight_requests:+                self._inflight_requests[server_id] += 1+                return server_id, self._servers[server_id]+            del self._request_id_to_server[request_id]++        if not self._inflight_requests:+            raise RuntimeError("No available servers in load balancer")++        server_id = min(self._inflight_requests, key=self._inflight_requests.get)+        self._request_id_to_server[request_id] = server_id+        self._inflight_requests[server_id] += 1+        return server_id, self._servers[server_id]++    def release_server(self, server_id: str) -> None:+        """Release a server after a request completes."""+        if server_id in self._inflight_requests and self._inflight_requests[server_id] > 0:+            self._inflight_requests[server_id] -= 1++    def add_servers(self, servers: dict[str, ray.actor.ActorHandle]) -> None:+        """Atomically add multiple servers to the routing pool."""+        for server_id, handle in servers.items():+            self._inflight_requests[server_id] = 0+            self._servers[server_id] = handle+        logger.info("[GlobalLoadBalancer] added %d servers", len(servers))++    def remove_servers(self, server_ids: list[str]) -> None:+        """Atomically remove multiple servers from the routing pool."""+        for server_id in server_ids:+            self._inflight_requests.pop(server_id, None)+            self._servers.pop(server_id, None)+        logger.info("[GlobalLoadBalancer] removed %d servers", len(server_ids))++    def get_inflight_count(self, server_id: str) -> int:+        """Return the number of requests currently routed to a server."""+        return self._inflight_requests.get(server_id, 0)++    def get_all_servers(self) -> list[str]:+        """Return all active server identifiers."""+        return list(self._inflight_requests)++    def get_status(self) -> dict:+        """Return current load-balancer state for readiness and debugging."""+        return {+            "servers": dict(self._inflight_requests),+            "total_inflight": sum(self._inflight_requests.values()),+            "active_servers": len(self._inflight_requests),+            "registered_handles": list(self._servers),+        }diff --git a/verl/trainer/config/_generated_ppo_megatron_trainer.yaml b/verl/trainer/config/_generated_ppo_megatron_trainer.yamlindex f714097473ce6fed680adeb83cd9b8d4b9e1d7db..c05e9b72c2573eb1e5d990c287e162a945425d8b 100644--- a/verl/trainer/config/_generated_ppo_megatron_trainer.yaml+++ b/verl/trainer/config/_generated_ppo_megatron_trainer.yaml@@ -99,7 +99,7 @@ actor_rollout_ref:       clip_cov_ub: 5.0       kl_cov_ratio: 0.0002       ppo_kl_coef: 0.1-    clip_ratio_c: 3.0+    clip_ratio_c: null     loss_agg_mode: token-mean     loss_scale_factor: null     entropy_coeff: 0diff --git a/verl/trainer/config/_generated_ppo_torchtitan_trainer.yaml b/verl/trainer/config/_generated_ppo_torchtitan_trainer.yamlindex b3f915276182a38050d4cce5c535b9401a67e99c..903bd2e8f18145e45636c2273a9ee19d80c40ed2 100644--- a/verl/trainer/config/_generated_ppo_torchtitan_trainer.yaml+++ b/verl/trainer/config/_generated_ppo_torchtitan_trainer.yaml@@ -69,7 +69,7 @@ actor_rollout_ref:       clip_cov_ub: 5.0       kl_cov_ratio: 0.0002       ppo_kl_coef: 0.1-    clip_ratio_c: 3.0+    clip_ratio_c: null     loss_agg_mode: token-mean     loss_scale_factor: null     entropy_coeff: 0diff --git a/verl/trainer/config/_generated_ppo_trainer.yaml b/verl/trainer/config/_generated_ppo_trainer.yamlindex ce4879e440ba1f858dcd98f487f4f627cab16afe..c0c6a5dfd9d6e0fd1b203407235f92e308df7072 100644--- a/verl/trainer/config/_generated_ppo_trainer.yaml+++ b/verl/trainer/config/_generated_ppo_trainer.yaml@@ -78,7 +78,7 @@ actor_rollout_ref:       clip_cov_ub: 5.0       kl_cov_ratio: 0.0002       ppo_kl_coef: 0.1-    clip_ratio_c: 3.0+    clip_ratio_c: null     loss_agg_mode: token-mean     loss_scale_factor: null     entropy_coeff: 0diff --git a/verl/trainer/config/_generated_ppo_veomni_trainer.yaml b/verl/trainer/config/_generated_ppo_veomni_trainer.yamlindex bacf0617ed4718a4e47ce4832328b34e79be9314..65835db5d26a6655d288998462174d518c72d622 100644--- a/verl/trainer/config/_generated_ppo_veomni_trainer.yaml+++ b/verl/trainer/config/_generated_ppo_veomni_trainer.yaml@@ -76,7 +76,7 @@ actor_rollout_ref:       clip_cov_ub: 5.0       kl_cov_ratio: 0.0002       ppo_kl_coef: 0.1-    clip_ratio_c: 3.0+    clip_ratio_c: null     loss_agg_mode: token-mean     loss_scale_factor: null     entropy_coeff: 0diff --git a/verl/trainer/config/actor/actor.yaml b/verl/trainer/config/actor/actor.yamlindex 03ef392984d7094f4750b5e341da7e96361a9998..caab3260dfdb534bd4cf466ae8614d63611f424a 100644--- a/verl/trainer/config/actor/actor.yaml+++ b/verl/trainer/config/actor/actor.yaml@@ -75,8 +75,8 @@ policy_loss:   # KL divergence penalty coefficient   ppo_kl_coef: 0.1 -# Constant C in Dual-clip PPO; clips when advantage < 0 and ratio > C-clip_ratio_c: 3.0+# Optional constant C in Dual-clip PPO; clips when advantage < 0 and ratio > C+clip_ratio_c: null  # Loss aggregation mode: "token-mean", "seq-mean-token-sum", "seq-mean-token-mean", or "seq-mean-token-sum-norm" loss_agg_mode: token-mean@@ -317,4 +317,3 @@ qat:    # Path to vLLM quantization config JSON file   quantization_config_path: null-diff --git a/verl/trainer/ppo/core_algos.py b/verl/trainer/ppo/core_algos.pyindex 5e6a19a15d1643139901d94689a37167937f4689..b5b3aa7c911ef5872b73fb6c445c419b4de708ee 100644--- a/verl/trainer/ppo/core_algos.py+++ b/verl/trainer/ppo/core_algos.py@@ -1208,7 +1208,7 @@ def compute_policy_loss(     cliprange=None,     cliprange_low=None,     cliprange_high=None,-    clip_ratio_c=3.0,+    clip_ratio_c=None,     loss_agg_mode: str = "token-mean", ):     """@@ -1234,15 +1234,16 @@ def compute_policy_loss(         cliprange_high (float, optional):             Upper clip range for dual-clip PPO. Defaults to same as `cliprange`.         clip_ratio_c (float, optional):-            Lower bound of the ratio for dual-clip PPO. See https://arxiv.org/pdf/1912.09729.-            Defaults to 3.0.+            Upper bound of the ratio for dual-clip PPO. See https://arxiv.org/pdf/1912.09729.+            Dual clipping is disabled when this is `None`.         loss_agg_mode (str, optional):             Aggregation mode for `agg_loss`. Defaults to "token-mean".     """-    assert clip_ratio_c > 1.0, (-        "The lower bound of the clip_ratio_c for dual-clip PPO should be greater than 1.0,"-        + f" but get the value: {clip_ratio_c}."-    )+    if clip_ratio_c is not None:+        assert clip_ratio_c > 1.0, (+            "The upper bound of the clip_ratio_c for dual-clip PPO should be greater than 1.0,"+            + f" but get the value: {clip_ratio_c}."+        )      negative_approx_kl = log_prob - old_log_prob     # Clamp negative_approx_kl for stability@@ -1263,13 +1264,16 @@ def compute_policy_loss(     )  # max(-ratio * A, -clip(ratio, 1-cliprange, 1+cliprange) * A)     pg_clipfrac = verl_F.masked_mean(torch.gt(pg_losses2, pg_losses1).float(), response_mask) -    pg_losses3 = -advantages * clip_ratio_c-    clip_pg_losses2 = torch.min(pg_losses3, clip_pg_losses1)-    pg_clipfrac_lower = verl_F.masked_mean(-        torch.gt(clip_pg_losses1, pg_losses3) * (advantages < 0).float(), response_mask-    )--    pg_losses = torch.where(advantages < 0, clip_pg_losses2, clip_pg_losses1)+    if clip_ratio_c is None:+        pg_losses = clip_pg_losses1+        pg_clipfrac_lower = torch.zeros((), device=pg_losses.device)+    else:+        pg_losses3 = -advantages * clip_ratio_c+        clip_pg_losses2 = torch.min(pg_losses3, clip_pg_losses1)+        pg_clipfrac_lower = verl_F.masked_mean(+            torch.gt(clip_pg_losses1, pg_losses3) * (advantages < 0).float(), response_mask+        )+        pg_losses = torch.where(advantages < 0, clip_pg_losses2, clip_pg_losses1)     pg_loss = agg_loss(loss_mat=pg_losses, loss_mask=response_mask, loss_agg_mode=loss_agg_mode)      return pg_loss, pg_clipfrac, ppo_kl, pg_clipfrac_lower@@ -1313,18 +1317,17 @@ def compute_policy_loss_vanilla(     clip_ratio = config.clip_ratio  # Clipping parameter ε for standard PPO. See https://arxiv.org/abs/1707.06347.     clip_ratio_low = config.clip_ratio_low if config.clip_ratio_low is not None else clip_ratio     clip_ratio_high = config.clip_ratio_high if config.clip_ratio_high is not None else clip_ratio-    clip_ratio_c = config.get(  # Lower bound of the ratio for dual-clip PPO. See https://arxiv.org/pdf/1912.09729.-        "clip_ratio_c", 3.0-    )+    clip_ratio_c = config.get("clip_ratio_c", None)      cliprange = clip_ratio     cliprange_low = clip_ratio_low     cliprange_high = clip_ratio_high -    assert clip_ratio_c > 1.0, (-        "The lower bound of the clip_ratio_c for dual-clip PPO should be greater than 1.0,"-        + f" but get the value: {clip_ratio_c}."-    )+    if clip_ratio_c is not None:+        assert clip_ratio_c > 1.0, (+            "The upper bound of the clip_ratio_c for dual-clip PPO should be greater than 1.0,"+            + f" but get the value: {clip_ratio_c}."+        )      negative_approx_kl = log_prob - old_log_prob     # Clamp negative_approx_kl for stability@@ -1345,13 +1348,16 @@ def compute_policy_loss_vanilla(     )  # max(-ratio * A, -clip(ratio, 1-cliprange, 1+cliprange) * A)     pg_clipfrac = verl_F.masked_mean(torch.gt(pg_losses2, pg_losses1).float(), response_mask) -    pg_losses3 = -advantages * clip_ratio_c-    clip_pg_losses2 = torch.min(pg_losses3, clip_pg_losses1)-    pg_clipfrac_lower = verl_F.masked_mean(-        torch.gt(clip_pg_losses1, pg_losses3) * (advantages < 0).float(), response_mask-    )--    pg_losses = torch.where(advantages < 0, clip_pg_losses2, clip_pg_losses1)+    if clip_ratio_c is None:+        pg_losses = clip_pg_losses1+        pg_clipfrac_lower = torch.zeros((), device=pg_losses.device)+    else:+        pg_losses3 = -advantages * clip_ratio_c+        clip_pg_losses2 = torch.min(pg_losses3, clip_pg_losses1)+        pg_clipfrac_lower = verl_F.masked_mean(+            torch.gt(clip_pg_losses1, pg_losses3) * (advantages < 0).float(), response_mask+        )+        pg_losses = torch.where(advantages < 0, clip_pg_losses2, clip_pg_losses1)      # Apply rollout correction weights if provided     if rollout_is_weights is not None:diff --git a/verl/workers/config/actor.py b/verl/workers/config/actor.pyindex ed80a551b5e63c529c419eefee3599ced26800f2..7a70b2de37bfa0cfb5051bac7d0eefd33a398070 100644--- a/verl/workers/config/actor.py+++ b/verl/workers/config/actor.py@@ -117,7 +117,7 @@ class ActorConfig(BaseConfig):         clip_ratio_low (float): Lower bound for PPO clipping ratio.         clip_ratio_high (float): Upper bound for PPO clipping ratio.         policy_loss (PolicyLossConfig): Configuration for policy loss computation.-        clip_ratio_c (float): Clipping ratio for critic loss.+        clip_ratio_c (float, optional): Constant C for opt-in dual-clip PPO.         loss_agg_mode (str): Loss aggregation mode. Options: 'token-mean', 'sample-mean'.         loss_scale_factor (Optional[int]): Scale factor for 'seq-mean-token-sum-norm' loss aggregation mode.             If None, uses response_length. Set to a constant to ensure consistent normalization.@@ -159,7 +159,9 @@ class ActorConfig(BaseConfig):     clip_ratio_high: float = 0.2     freeze_vision_tower: bool = False     policy_loss: PolicyLossConfig = field(default_factory=PolicyLossConfig)-    clip_ratio_c: float = 3.0+    # Dual-clip PPO is opt-in. ``None`` keeps the vanilla policy loss equal to+    # the standard clipped PPO objective.+    clip_ratio_c: Optional[float] = None     loss_agg_mode: str = "token-mean"     loss_scale_factor: Optional[int] = None     entropy_coeff: float = 0diff --git a/verl/workers/rollout/llm_server.py b/verl/workers/rollout/llm_server.pyindex 415a4e17bbb1895f5964b5780708af59d564dc4a..11e4aa290922f0c23e92e56f84df379e1dc5c700 100644--- a/verl/workers/rollout/llm_server.py+++ b/verl/workers/rollout/llm_server.py@@ -25,9 +25,9 @@ from typing import Any, Optional from uuid import uuid4  import ray-from cachetools import LRUCache from omegaconf import DictConfig +from verl.rollout_load_balancer import DEFAULT_ROUTING_CACHE_SIZE, GlobalRequestLoadBalancer from verl.single_controller.ray.base import RayResourcePool, RayWorkerGroup from verl.utils.ray_utils import auto_await from verl.utils.rollout_trace import rollout_trace_op@@ -37,111 +37,6 @@ from verl.workers.rollout.utils import update_prometheus_config logger = logging.getLogger(__file__) logger.setLevel(os.getenv("VERL_LOGGING_LEVEL", "WARN")) -DEFAULT_ROUTING_CACHE_SIZE = 10000---@ray.remote-class GlobalRequestLoadBalancer:-    """Global sticky-session + in-flight load balancer shared by all AgentLoopWorkers.--    When a sticky session points to a removed server, the cache entry is-    automatically invalidated and a new server is selected.--    Key features:-    - **Atomic acquire**: ``acquire_server()`` returns ``(server_id, handle)``-    - **Sticky Session**: Uses LRUCache to map request_id → server_id, ensuring-      multi-turn conversations route to the same server.-    - **Least-loaded Selection**: When no sticky session exists, selects the-      server with the fewest in-flight requests.-    - **Dynamic Server Management**: Supports add/remove servers at runtime-      for hybrid scaling.-    """--    def __init__(self, servers: dict[str, ray.actor.ActorHandle], max_cache_size: int = DEFAULT_ROUTING_CACHE_SIZE):-        if not servers:-            raise ValueError("servers must be non-empty")--        self._servers: dict[str, ray.actor.ActorHandle] = dict(servers)-        self._inflight_requests: dict[str, int] = {sid: 0 for sid in servers}-        self._request_id_to_server: LRUCache = LRUCache(maxsize=max_cache_size)--    def acquire_server(self, request_id: str) -> tuple[str, ray.actor.ActorHandle]:-        """Acquire a server for the given request (sticky + least-loaded).--        Returns:-            A tuple of ``(server_id, actor_handle)`` in a single atomic call.-        """-        # Try sticky session first-        if request_id in self._request_id_to_server:-            server_id = self._request_id_to_server[request_id]-            # Check if server is still in the active pool-            if server_id in self._inflight_requests:-                self._inflight_requests[server_id] += 1-                return server_id, self._servers[server_id]-            # Server was removed, clear stale cache entry and re-select-            del self._request_id_to_server[request_id]--        # Select new server (least-loaded among available)-        if not self._inflight_requests:-            raise RuntimeError("No available servers in load balancer")--        server_id = min(self._inflight_requests, key=self._inflight_requests.get)-        self._request_id_to_server[request_id] = server_id-        self._inflight_requests[server_id] += 1-        return server_id, self._servers[server_id]--    def release_server(self, server_id: str) -> None:-        """Release a server after a request completes."""-        if server_id not in self._inflight_requests:-            return-        if self._inflight_requests[server_id] > 0:-            self._inflight_requests[server_id] -= 1--    def add_servers(self, servers: dict[str, ray.actor.ActorHandle]) -> None:-        """Atomically add multiple servers to the load balancer pool.--        This is more efficient than calling :meth:`add_server` in a loop-        because it performs a single bulk update on the internal state.--        Args:-            servers: Dict mapping server_id → actor_handle for all servers-                to register.-        """-        for sid, handle in servers.items():-            self._inflight_requests[sid] = 0-            self._servers[sid] = handle-        logger.info(f"[GlobalLoadBalancer] added {len(servers)} servers")--    def remove_servers(self, server_ids: list[str]) -> None:-        """Atomically remove multiple servers from the load balancer pool.--        More efficient than calling :meth:`remove_server` in a loop.--        Args:-            server_ids: List of server identifiers to remove.-        """-        for sid in server_ids:-            self._inflight_requests.pop(sid, None)-            self._servers.pop(sid, None)-        logger.info(f"[GlobalLoadBalancer] removed {len(server_ids)} servers")--    def get_inflight_count(self, server_id: str) -> int:-        """Get number of in-flight requests for a server."""-        return self._inflight_requests.get(server_id, 0)--    def get_all_servers(self) -> list[str]:-        """Get list of all active server IDs."""-        return list(self._inflight_requests.keys())--    def get_status(self) -> dict:-        """Return current load balancer state for debugging."""-        return {-            "servers": dict(self._inflight_requests),-            "total_inflight": sum(self._inflight_requests.values()),-            "active_servers": len(self._inflight_requests),-            "registered_handles": list(self._servers.keys()),-        }-  class LLMServerClient:     """@@ -339,6 +234,9 @@ class LLMServerManager:             servers=dict(zip(self.server_addresses, self.server_handles, strict=True)),             max_cache_size=DEFAULT_ROUTING_CACHE_SIZE,         )+        # Actor creation is asynchronous. Complete its lightweight startup as+        # part of manager initialization instead of delaying the first request.+        await self.global_load_balancer.get_status.remote()      def get_client(self, client_cls=LLMServerClient, **kwargs) -> LLMServerClient:         """Get the LLMServerClient to request LLM server replicas.
vllm · 1 changed files

Base commit: 5a0277de14789b245c781911b3119ed6af901b7b

diff --git a/vllm/v1/core/kv_cache_utils.py b/vllm/v1/core/kv_cache_utils.pyindex 3da3d7e7bef720d2223976cdad4506c04b7916fa..b05198a2c17754ccb25c84dd29eb5b90b97327f3 100644--- a/vllm/v1/core/kv_cache_utils.py+++ b/vllm/v1/core/kv_cache_utils.py@@ -817,6 +817,49 @@ def get_max_concurrency_for_kv_cache_config(     return max_concurrency  +def _cap_sleep_mode_num_blocks(+    vllm_config: VllmConfig,+    kv_cache_groups: list[KVCacheGroupSpec],+    num_blocks: int,+) -> int:+    """Bound disposable sleep-mode KV cache to the scheduler's working set.++    Sleep mode discards the KV cache at every phase boundary, so capacity far+    beyond what the scheduler can make resident cannot survive to benefit a+    later phase. Mapping and unmapping that excess capacity can dominate short+    colocated training phases. Keep room for the maximum active batch plus an+    equally sized prefix-cache working set.+    """+    if (+        not vllm_config.model_config.enable_sleep_mode+        or vllm_config.cache_config.num_gpu_blocks_override is not None+        or not kv_cache_groups+    ):+        return num_blocks++    num_layers_per_group = max(len(group.layer_names) for group in kv_cache_groups)+    max_memory_per_request = num_layers_per_group * max_memory_usage_bytes(+        vllm_config, (group.kv_cache_spec for group in kv_cache_groups)+    )+    memory_per_block = (+        kv_cache_groups[0].kv_cache_spec.page_size_bytes * num_layers_per_group+    )+    blocks_per_request = cdiv(max_memory_per_request, memory_per_block)+    working_set_blocks = (+        2 * vllm_config.scheduler_config.max_num_seqs * blocks_per_request+    )+    if num_blocks > working_set_blocks:+        logger.info(+            "Capping sleep-mode KV cache from %d to %d blocks "+            "(%d active sequences plus prefix-cache headroom)",+            num_blocks,+            working_set_blocks,+            vllm_config.scheduler_config.max_num_seqs,+        )+        return working_set_blocks+    return num_blocks++ def may_override_num_blocks(vllm_config: VllmConfig, num_blocks: int) -> int:     """     Override the number of kv cache blocks if `num_gpu_blocks_override` is set.@@ -1111,6 +1154,9 @@ def get_kv_cache_config_from_groups(             available_memory // kv_cache_groups[0].kv_cache_spec.page_size_bytes         )         num_blocks = may_override_num_blocks(vllm_config, num_blocks)+        num_blocks = _cap_sleep_mode_num_blocks(+            vllm_config, kv_cache_groups, num_blocks+        )         per_layer_specs = kv_cache_groups[0].kv_cache_spec.kv_cache_specs         kv_cache_tensors = [             KVCacheTensor(@@ -1137,6 +1183,9 @@ def get_kv_cache_config_from_groups(         num_blocks = get_num_blocks(             vllm_config, group_size, available_memory, page_size         )+        num_blocks = _cap_sleep_mode_num_blocks(+            vllm_config, kv_cache_groups, num_blocks+        )         kv_cache_tensors = []         for i in range(group_size):             shared_by = []
vllm_ascend · 1 changed files

Base commit: f649187194c44d86415d1ddfa49359e824932c9a

diff --git a/vllm_ascend/patch/platform/patch_mamba_config.py b/vllm_ascend/patch/platform/patch_mamba_config.pyindex 775e54743769e9f48de6fa316f05a48816b79f7d..8530da23309c8dd4a8a585b9490830f77b50a4c6 100644--- a/vllm_ascend/patch/platform/patch_mamba_config.py+++ b/vllm_ascend/patch/platform/patch_mamba_config.py@@ -50,15 +50,33 @@ def verify_and_update_config(cls, vllm_config) -> None:     mamba_sizes = []     for shape, dtype in zip(mamba_shapes, mamba_dtypes):         mamba_sizes.append(math.prod(shape) * get_dtype_size(dtype))-    ssm_block_page_size, conv_block_page_size = max(mamba_sizes), min(mamba_sizes)+    # Most Mamba models have separate convolution and SSM states. Short+    # convolution models such as LFM2 only have a convolution state, however,+    # and must be aligned directly with a complete attention (K + V) page.+    # Treating that sole state as both the SSM and convolution state makes the+    # exact SSM/K-page check below impossible and double-counts the state in+    # ``mamba_page_size_padded``.+    single_state_cache = len(mamba_sizes) == 1+    ssm_block_page_size = max(mamba_sizes)+    conv_block_page_size = 0 if single_state_cache else min(mamba_sizes)      # NOTE(zxr): because of the limit of Ascend Hardware, we need to keep     # all cache tensors contiguous, so we align the page size of ssm_block     # and single attn_block-    attn_block_size = kernel_block_size * cdiv(ssm_block_page_size, kernel_block_size * attn_single_token_k_page_size)-    assert attn_single_token_k_page_size * attn_block_size == ssm_block_page_size, (-        "Cannot align ssm_page_size and attn_page_size."-    )+    if single_state_cache:+        attn_single_token_page_size = 2 * attn_single_token_k_page_size+        attn_block_size = kernel_block_size * cdiv(+            ssm_block_page_size,+            kernel_block_size * attn_single_token_page_size,+        )+    else:+        attn_block_size = kernel_block_size * cdiv(+            ssm_block_page_size,+            kernel_block_size * attn_single_token_k_page_size,+        )+        assert attn_single_token_k_page_size * attn_block_size == ssm_block_page_size, (+            "Cannot align ssm_page_size and attn_page_size."+        )      # override attention block size if either (a) the     # user has not set it or (b) the user has set it@@ -79,7 +97,8 @@ def verify_and_update_config(cls, vllm_config) -> None:         or cache_config.mamba_page_size_padded != attn_page_size + conv_block_page_size     ):         cache_config.mamba_page_size_padded = attn_page_size + conv_block_page_size-        mamba_padding_pct = 100 * conv_block_page_size / cache_config.mamba_page_size_padded+        mamba_page_size = sum(mamba_sizes)+        mamba_padding_pct = 100 * (cache_config.mamba_page_size_padded - mamba_page_size) / mamba_page_size         logger.info(             "Padding mamba page size by %.2f%% to ensure "             "that mamba page size and attention page size are "