GPT-6 Astra · RL

R01 · GRPO code

Valid

Qwen3-0.6B CodeOpt GRPO 1dev · Implementation Optimization

2.21×PERFORMANCE RATIO
347TOOL EVENTS
3TEXT 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-6 Astra · 347 visible calls

InspectEditValidateExecuteBuildProfileRollbackOther
257Inspect
7Edit
9Build
34Validate
15Execute
25Other

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 timeline270 groups · 347 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 file and log inspection, workspace inspection and source searches related to task requirements.

    4 calls · #0001–#0004

    cat <path>pwdrg --files -g <val> -g <path> -g <path> <path> <path> <path> <path>cat <val>
  2. Inspect · Benchmark & validation setup

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

    1 call · #0005–#0005

    ls -l -a <val>cat <path> <path> <path> <path> <path> <path> <path>
  3. Inspect · Source & workspace

    Requested repository inspection related to source & workspace.

    1 call · #0006–#0006

    git status --short
  4. Inspect · Task requirements

    Requested file and log inspection related to task requirements.

    2 calls · #0007–#0008

    cat <val>
  5. Inspect · Source & workspace

    Requested repository inspection related to source & workspace.

    3 calls · #0009–#0011

    git status --short
  6. Inspect · Task requirements

    Requested file and log inspection related to task requirements.

    1 call · #0012–#0012

    cat <val>
  7. Inspect · Reward & policy updates

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

    1 call · #0013–#0013

    cat <path> <path> <path> <path>rg -n <val> <path>
  8. Inspect · Source & workspace

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

    1 call · #0014–#0014

    wc -l <path>rg -n <val> <path> <path>python - <script>
  9. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0015–#0015

    bash <script>
  10. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    4 calls · #0016–#0019

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

    Requested source searches related to checkpoints & weight state.

    1 call · #0020–#0020

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

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

    1 call · #0021–#0021

    tail -n <n> <path>
  13. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0022–#0023

    sed -n <val> <path>
  14. Inspect · Optimizer & gradients

    1 tool error

    Requested file and log inspection and source searches related to optimizer & gradients.

    1 call · #0024–#0024

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

    Requested file and log inspection related to source & workspace.

    2 calls · #0025–#0026

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

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

    2 calls · #0027–#0028

    rg -n <val> <path> <path>rg --files <val>rg <val>sed -n <val> <path>tail -n <n> <path>cat <path>
  17. Validate · Device memory

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

    1 call · #0029–#0029

    ls -l <val>cat <path>ps <flag> <args>head -n <n>npu-smi info
  18. Inspect · Benchmark & validation setup

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

    1 call · #0030–#0030

    tail -n <n> <path>
  19. Inspect · Device memory

    Requested file and log inspection related to device memory.

    1 call · #0031–#0031

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

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

    3 calls · #0032–#0034

    sed -n <val> <path>cat <path>rg -n <val> <path>
  21. Inspect · Rollout generation

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

    1 call · #0035–#0035

    rg -n <val> <path> <path>rg --files <val>rg <val>head -n <n>
  22. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0036–#0036

    sed -n <val> <path>
  23. Inspect · Benchmark & validation setup

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

    1 call · #0037–#0037

    tail -n <n> <path>
  24. Inspect · Rollout generation

    Requested file and log inspection related to rollout generation.

    1 call · #0038–#0038

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

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

    1 call · #0039–#0039

    sed -n <val> <path>rg -n <val> <path>tail -n <n>cat <val>head -n <n>
  26. Inspect · Rollout generation

    Requested file and log inspection related to rollout generation.

    1 call · #0040–#0040

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

    Requested source searches, file and log inspection and script or workload execution related to attention kernels.

    1 call · #0041–#0041

    rg --files <val>rg <val>head -n <n>command -v <val>python -c <script>
  28. Inspect · Benchmark & validation setup

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

    1 call · #0042–#0042

    tail -n <n> <path>
  29. Inspect · Batching & scheduling

    Requested file and log inspection and source searches related to batching & scheduling.

    1 call · #0043–#0043

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

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

    1 call · #0044–#0044

    tail -n <n> <path>ps <flag> <args>head -n <n>
  31. Inspect · Source & workspace

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

    1 call · #0045–#0045

    sed -n <val> <path>rg -n <val> <path> -g <path>
  32. Inspect · Rollout generation

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

    2 calls · #0046–#0047

    rg -n <val> <path> <path>rg --files <val>rg <val>sed -n <val> <path>tail -n <n> <path>
  33. Inspect · Device memory

    Requested file and log inspection related to device memory.

    1 call · #0048–#0048

    sed -n <val> <path>cat <path>
  34. Inspect · Benchmark & validation setup

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

    1 call · #0049–#0049

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

    Requested file and log inspection related to source & workspace.

    1 call · #0050–#0050

    sed -n <val> <path>cat <val>
  36. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0051–#0051

    Apply patch <patch>
  37. Inspect · Benchmark & validation setup

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

    1 call · #0052–#0052

    sed -n <val> <path>git diff --checktail -n <n> <path>
  38. Validate · Benchmark & validation setup

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

    1 call · #0053–#0053

    python -m <module> --versioncommand -v <val>git diff --stat
  39. Other · Attention kernels

    Requested script or workload execution related to attention kernels.

    1 call · #0054–#0054

    python - <script>
  40. Inspect · Benchmark & validation setup

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

    1 call · #0055–#0055

    tail -n <n> <path>ps <flag> <args>head -n <n>
  41. Inspect · Rollout generation

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

    2 calls · #0056–#0057

    rg --files <path> <path> <path> <path> <path> <n> > <path>rg <path>head -n <n>rg -n <val> <path>sed -n <val> <path>
  42. Inspect · Attention kernels

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

    1 call · #0058–#0058

    git diff --checkpython -m <module> -q <script> <script>
  43. Validate · Checkpoints & weight state

    Requested file and log inspection and script or workload execution related to checkpoints & weight state.

    1 call · #0059–#0059

    cat > <path> <script>python -m <module> <script> -q -k <val> > <path> <n> >& <path>
  44. Inspect · Benchmark & validation setup

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

    1 call · #0060–#0060

    tail -n <n> <path>
  45. Inspect · Optimizer & gradients

    Requested source searches and file and log inspection related to optimizer & gradients.

    1 call · #0061–#0061

    rg -n <val> <path>head -n <n>rg -n <val> <path> -g <path>sed -n <val> <path>
  46. Validate · Batching & scheduling

    1 tool error

    Requested script or workload execution related to batching & scheduling.

    1 call · #0062–#0062

    python -m <module> <script> <script> -q -k <val> > <path> <n> >& <path>
  47. Inspect · Optimizer & gradients

    Requested source searches and file and log inspection related to optimizer & gradients.

    1 call · #0063–#0063

    rg -n <val> <path>sed -n <val> <path>
  48. Validate · Attention kernels

    Requested script or workload execution related to attention kernels.

    1 call · #0064–#0064

    python -m <module> <script> -q -k <val> > <path> <n> >& <path>
  49. Inspect · Attention kernels

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

    3 calls · #0065–#0067

    rg -n <val> <val>rg -n <val> <path>sed -n <val> <path>rg -n <flag> <args>tail -n <n> <path>head -n <n> <path>
    1 more command sketches
    git diff --numstat
  50. Validate · Benchmark & validation setup

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

    1 call · #0068–#0068

    python -m <module> <script> -q -k <val> > <path> <n> >& <path>
  51. Edit · Optimizer & gradients

    Requested code edits related to optimizer & gradients.

    1 call · #0069–#0069

    Apply patch <patch>
  52. Validate · Benchmark & validation setup

    1 tool error

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

    1 call · #0070–#0070

    bash <script> > <path> <n> >& <path>
  53. Inspect · Optimizer & gradients

    Requested file and log inspection related to optimizer & gradients.

    1 call · #0071–#0071

    tail -n <n> <path>
  54. Inspect · Source & workspace

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

    1 call · #0072–#0072

    rg -n <val> <path> <path>head -n <n>sed -n <val> <path>
  55. Validate · Checkpoints & weight state

    Requested file and log inspection and script or workload execution related to checkpoints & weight state.

    1 call · #0073–#0073

    cat > <path> <script>python -m <module> <script> -q > <path> <n> >& <path>
  56. Validate · Benchmark & validation setup

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

    1 call · #0074–#0074

    python - <script>
  57. Inspect · Optimizer & gradients

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

    1 call · #0075–#0075

    rg -n <flag> <args>ls <path>rg <val>tail -n <n> <path>
  58. Execute · Checkpoints & weight state

    1 tool error

    Requested file and log inspection and script or workload execution related to checkpoints & weight state.

    1 call · #0076–#0076

    cat > <path> <script>python <script> > <path> <n> >& <path>
  59. Build · Dependencies & build setup

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

    1 call · #0077–#0077

    rg -n <val> <path> <path> <val> <n> > <path>head -n <n>sed -n <val> <path>ls -l -a <path>
  60. Inspect · Optimizer & gradients

    Requested file and log inspection related to optimizer & gradients.

    1 call · #0078–#0078

    tail -n <n> <path>
  61. Build · Dependencies & build setup

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

    1 call · #0079–#0079

    rg -n <val> <path>python -m <module> <val> --no-deps <flag> <args>
  62. Inspect · Attention kernels

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

    1 call · #0080–#0080

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

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

    1 call · #0081–#0081

    sed -n <val> <path>rg -n <val> <path> <path> <path>head -n <n>
  64. Execute · Parallelism & communication

    Requested script or workload execution related to parallelism & communication.

    1 call · #0082–#0082

    python - <script>python <script> > <path> <n> >& <path>
  65. Validate · Batching & scheduling

    Requested script or workload execution related to batching & scheduling.

    1 call · #0083–#0083

    python - <script>
  66. Inspect · Optimizer & gradients

    Requested file and log inspection related to optimizer & gradients.

    1 call · #0084–#0084

    tail -n <n> <path>
  67. Other · Dependencies & build setup

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

    1 call · #0085–#0085

    python -m <module> <val> --no-deps <flag> <args>
  68. Inspect · Rollout generation

    Requested file and log inspection related to rollout generation.

    1 call · #0086–#0086

    sed -n <val> <path>
  69. Build · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0087–#0087

    python - <script>
  70. Inspect · Rollout generation

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

    1 call · #0088–#0088

    rg -n <val> <path>head -n <n>sed -n <val> <path>rg -n <val> <path> -g <path>tail -n <n> <path>
  71. Inspect · Benchmark & validation setup

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

    1 call · #0089–#0089

    tail -n <n> <path>ps <flag> <args>head -n <n>git status --short
  72. Inspect · Rollout generation

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

    1 call · #0090–#0090

    rg -n <val> <path>tail -n <n>head -n <n>sed -n <val> <path>
  73. Other · Attention kernels

    Requested script or workload execution related to attention kernels.

    2 calls · #0091–#0092

    python - <script><command> <args>
  74. Validate · KV-cache management

    Requested script or workload execution and file and log inspection related to kv-cache management.

    1 call · #0093–#0093

    python - <script>sed -n <val> <path>
  75. Inspect · Rollout generation

    1 tool error

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

    1 call · #0094–#0094

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

    1 tool error

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

    1 call · #0095–#0095

    sed -n <val> <path>rg -n <val> <path>
  77. Inspect · Rollout generation

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

    1 call · #0096–#0096

    rg -n <val> <path>head -n <n>rg --files <val>rg <val>sed -n <val> <path>
  78. Validate · KV-cache management

    Requested script or workload execution, source searches and file and log inspection related to kv-cache management.

    1 call · #0097–#0097

    python - <script>rg -n <val> <path>head -n <n>
  79. Edit · KV-cache management

    Requested code edits related to kv-cache management.

    1 call · #0098–#0098

    Apply patch <patch>
  80. Inspect · KV-cache management

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

    1 call · #0099–#0099

    <command> <args>sed -n <val> <path>
  81. Inspect · Benchmark & validation setup

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

    1 call · #0100–#0100

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

    Requested code edits related to rollout generation.

    1 call · #0101–#0101

    Apply patch <patch>
  83. Other · Rollout generation

    Requested repository inspection related to rollout generation.

    1 call · #0102–#0102

    <command> <args>git diff --stat
  84. Execute · Benchmark & validation setup

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

    1 call · #0103–#0103

    python - <script>
  85. Validate · KV-cache management

    1 tool error

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

    1 call · #0104–#0104

    python -m <module> <script> -q -k <val> > <path> <n> >& <path>
  86. Build · Source & workspace

    Requested environment setup or inspection related to source & workspace.

    1 call · #0105–#0105

    env <vars> make <val> > <path> <n> >& <path>
  87. Validate · Attention kernels

    Requested file and log inspection and script or workload execution related to attention kernels.

    1 call · #0106–#0106

    cat > <path> <script>python -m <module> <script> -q > <path> <n> >& <path>
  88. Inspect · Source & workspace

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

    1 call · #0107–#0107

    tail -n <n> <path>git status --short
  89. Execute · Optimizer & gradients

    Requested script or workload execution and repository inspection related to optimizer & gradients.

    1 call · #0108–#0108

    python - <script>git diff --checkgit diff <flag> <args>
  90. Execute · Benchmark & validation setup

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

    1 call · #0109–#0109

    rg -n <val> <path> <path> <path>sed -n <val> <path>python - <script>
  91. Execute · Rollout generation

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

    1 call · #0110–#0110

    python - <script>sed -n <val> <path>
  92. Execute · Benchmark & validation setup

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

    1 call · #0111–#0111

    sed -n <val> <path>python - <script>
  93. Execute · Attention kernels

    Requested script or workload execution related to attention kernels.

    1 call · #0112–#0112

    python - <script>bash <script> > <path> <n> >& <path>
  94. Execute · KV-cache management

    Requested script or workload execution, runtime inspection and file and log inspection related to kv-cache management.

    1 call · #0113–#0113

    python - <script>ps <flag> <args>head -n <n>
  95. Other · Dependencies & build setup

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

    1 call · #0114–#0114

    python -m <module> <val> --no-deps <flag> <args>
  96. Inspect · Rollout generation

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

    1 call · #0115–#0115

    rg -n <flag> <args>sed -n <val> <path>rg -n <val> <path> <path>
  97. Inspect · Benchmark & validation setup

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

    1 call · #0116–#0116

    tail -n <n> <path>git status --shortgit diff --check
  98. Validate · KV-cache management

    1 tool error

    Requested file and log inspection, script or workload execution and environment setup or inspection related to kv-cache management.

    1 call · #0117–#0117

    cat <path>python - <script>env <vars> python -m <module> <script> -q -k <val> > <path> <n> <args>
  99. Validate · Speculative decoding

    Requested file and log inspection and script or workload execution related to speculative decoding.

    1 call · #0118–#0118

    cat > <path> <script>python -m <module> <script> -q > <path> <n> >& <path>
  100. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0119–#0119

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

    Requested script or workload execution related to source & workspace.

    1 call · #0120–#0120

    python - <script>
  102. Validate · Optimizer & gradients

    Requested script or workload execution related to optimizer & gradients.

    1 call · #0121–#0121

    <command> <args>python -m <module> <script> -q > <path> <n> >& <path>
  103. Inspect · Benchmark & validation setup

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

    1 call · #0122–#0122

    tail -n <n> <path>
  104. Inspect · Optimizer & gradients

    Requested file and log inspection related to optimizer & gradients.

    1 call · #0123–#0123

    tail -n <n> <path>
  105. Inspect · Source & workspace

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

    1 call · #0124–#0124

    rg -n -A <n> -B <n> <val> <path>head -n <n>
  106. Inspect · Benchmark & validation setup

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

    2 calls · #0125–#0126

    tail -n <n> <path>
  107. Inspect · Task requirements

    Requested file and log inspection related to task requirements.

    2 calls · #0127–#0128

    cat <path>
  108. Inspect · Source & workspace

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

    4 calls · #0129–#0132

    git diff --statrg -n -A <n> -B <n> <val> <path>
  109. Inspect · Attention kernels

    Requested repository inspection related to attention kernels.

    1 call · #0133–#0133

    git diff <flag> <args>
  110. Inspect · Rollout generation

    Requested repository inspection related to rollout generation.

    1 call · #0134–#0134

    git diff <flag> <args>
  111. Inspect · KV-cache management

    Requested source searches related to kv-cache management.

    1 call · #0135–#0135

    rg -n <val> <path>
  112. Inspect · Optimizer & gradients

    Requested file and log inspection related to optimizer & gradients.

    1 call · #0136–#0136

    cat <path>
  113. Inspect · Benchmark & validation setup

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

    1 call · #0137–#0137

    rg -n <val> <path>tail -n <n>
  114. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0138–#0139

    sed -n <val> <path>tail -n <n> <path>
  115. Inspect · KV-cache management

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

    2 calls · #0140–#0141

    sed -n <val> <path>
  116. Inspect · Benchmark & validation setup

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

    1 call · #0142–#0142

    tail -n <n> <path>
  117. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0143–#0143

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

    Requested file and log inspection related to source & workspace.

    2 calls · #0144–#0145

    tail -n <n> <path>sed -n <val> <path>
  119. Inspect · KV-cache management

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

    1 call · #0146–#0146

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

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

    2 calls · #0147–#0148

    ps <flag> <args>head -n <n>tail -n <n> <path>
  121. Inspect · Benchmark & validation setup

    1 tool error

    Requested source searches related to benchmark & validation setup.

    1 call · #0149–#0149

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

    Requested source searches related to source & workspace.

    1 call · #0150–#0150

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

    Requested source searches related to rollout generation.

    1 call · #0151–#0151

    rg -n <val> <path> <path> <path>
  124. Inspect · Checkpoints & weight state

    1 tool error

    Requested source searches related to checkpoints & weight state.

    1 call · #0152–#0152

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

    Requested file and log inspection related to rollout generation.

    1 call · #0153–#0153

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

    1 tool error

    Requested source searches related to device memory.

    1 call · #0154–#0154

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

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

    2 calls · #0155–#0156

    sed -n <val> <path>rg -n <val> <path> <path> <path>
  128. Validate · KV-cache management

    Requested environment setup or inspection related to kv-cache management.

    1 call · #0157–#0157

    env <vars> python - <script>
  129. Inspect · Benchmark & validation setup

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

    1 call · #0158–#0158

    tail -n <n> <path>
  130. Inspect · Device memory

    Requested file and log inspection related to device memory.

    1 call · #0159–#0159

    sed -n <val> <path>
  131. Inspect · Rollout generation

    Requested file and log inspection related to rollout generation.

    1 call · #0160–#0160

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

    Requested source searches related to source & workspace.

    1 call · #0161–#0161

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

    Requested file and log inspection related to rollout generation.

    1 call · #0162–#0162

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

    Requested file and log inspection related to source & workspace.

    2 calls · #0163–#0164

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

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

    1 call · #0165–#0165

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

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

    1 call · #0166–#0166

    tail -n <n> <path>
  137. Inspect · Attention kernels

    Requested source searches related to attention kernels.

    1 call · #0167–#0167

    rg --files <val>rg <val>
  138. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0168–#0168

    sed -n <val> <val>
  139. Inspect · Dependencies & build setup

    Requested source searches related to dependencies & build setup.

    1 call · #0169–#0169

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

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

    1 call · #0170–#0170

    tail -n <n> <path>
  141. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0171–#0171

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

    Requested source searches related to checkpoints & weight state.

    1 call · #0172–#0172

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

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

    1 call · #0173–#0173

    tail -n <n> <path>
  144. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0174–#0174

    tail -n <n> <path>
  145. Inspect · Device memory

    Requested file and log inspection related to device memory.

    1 call · #0175–#0175

    cat <path>
  146. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0176–#0176

    sed -n <val> <path>
  147. Other · Dependencies & build setup

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

    1 call · #0177–#0177

    python -m <module> <val> --no-deps <flag> <args>
  148. Inspect · Task requirements

    Requested file and log inspection related to task requirements.

    1 call · #0178–#0178

    cat <path>
  149. Inspect · Benchmark & validation setup

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

    1 call · #0179–#0179

    tail -n <n> <path>
  150. Inspect · Device memory

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

    1 call · #0180–#0180

    rg -n <val> <path>tail -n <n>
  151. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0181–#0182

    tail -n <n> <path>
  152. Inspect · Benchmark & validation setup

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

    1 call · #0183–#0183

    tail -n <n> <path>
  153. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0184–#0185

    sed -n <val> <path>tail -n <n> <path>
  154. Build · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0186–#0186

    python - <script>
  155. Inspect · Benchmark & validation setup

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

    3 calls · #0187–#0189

    rg -n <val> <path>tail -n <n>tail -n <n> <path>rg --files <val>rg <val>
  156. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0190–#0190

    tail -n <n> <path>
  157. Validate · Benchmark & validation setup

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

    1 call · #0191–#0191

    python - <script>
  158. Inspect · Benchmark & validation setup

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

    1 call · #0192–#0192

    tail -n <n> <path>cut -c <val>
  159. Inspect · Batching & scheduling

    Requested source searches related to batching & scheduling.

    1 call · #0193–#0193

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

    Requested file and log inspection related to source & workspace.

    1 call · #0194–#0194

    sed -n <val> <path>
  161. Inspect · Optimizer & gradients

    Requested source searches related to optimizer & gradients.

    1 call · #0195–#0195

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

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

    2 calls · #0196–#0197

    tail -n <n> <path>rg -n <val> <val>
  163. Inspect · Rollout generation

    Requested file and log inspection related to rollout generation.

    1 call · #0198–#0198

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

    Requested file and log inspection related to source & workspace.

    1 call · #0199–#0199

    sed -n <val> <path>
  165. Inspect · Rollout generation

    Requested file and log inspection related to rollout generation.

    2 calls · #0200–#0201

    cat <path>sed -n <val> <path>
  166. Inspect · Runtime processes

    1 tool error

    Requested source searches related to runtime processes.

    1 call · #0202–#0202

    rg --files <val>rg <val>
  167. Inspect · Rollout generation

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

    3 calls · #0203–#0205

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

    Requested file and log inspection related to source & workspace.

    1 call · #0206–#0206

    tail -n <n> <path>
  169. Inspect · Runtime processes

    Requested file and log inspection related to runtime processes.

    1 call · #0207–#0207

    tail -n <n> <path>
  170. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0208–#0208

    sed -n <val> <path>cat <path>
  171. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0209–#0209

    python -X <val> -c <script> > <path> <n> > <path>
  172. Execute · Rollout generation

    Requested script or workload execution related to rollout generation.

    1 call · #0210–#0210

    python -X <val> -c <script> > <path> <n> > <path>
  173. Build · Source & workspace

    Requested environment setup or inspection related to source & workspace.

    1 call · #0211–#0211

    env <vars> make <val> > <path> <n> >& <path>
  174. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0212–#0213

    tail -n <n> <path>
  175. Inspect · Runtime processes

    Requested file and log inspection related to runtime processes.

    1 call · #0214–#0214

    tail -n <n> <path>
  176. Inspect · Source & workspace

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

    2 calls · #0215–#0216

    git status --shortrg -n <val> <path>
  177. Inspect · Rollout generation

    Requested source searches related to rollout generation.

    1 call · #0217–#0217

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

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

    7 calls · #0218–#0224

    tail -n <n> <path>cut -c <val>ps <flag> <args>head -n <n>sed -n <val> <path>ps -o <val> -p <val>
  179. Other · Rollout generation

    Requested script or workload execution related to rollout generation.

    1 call · #0225–#0225

    python - <script>
  180. Other · Source & workspace

    1 tool error

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

    2 calls · #0226–#0227

    env <vars> python <script> > <path> <n> >& <path>kill <flag> <args>
  181. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0228–#0229

    cat <path>tail -n <n> <path>cut -c <val>
  182. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0230–#0230

    python - <script>
  183. Other · Rollout generation

    Requested script or workload execution related to rollout generation.

    2 calls · #0231–#0232

    python - <script>
  184. Other · Source & workspace

    Requested environment setup or inspection related to source & workspace.

    1 call · #0233–#0233

    env <vars> python <script> > <path> <n> >& <path>
  185. Inspect · Source & workspace

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

    2 calls · #0234–#0235

    cat <path>rg -n <val> <path>tail -n <n>
  186. Inspect · Runtime processes

    1 tool error

    Requested source searches related to runtime processes.

    1 call · #0236–#0236

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

    Requested file and log inspection related to rollout generation.

    1 call · #0237–#0237

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

    1 tool error

    Requested file and log inspection related to source & workspace.

    1 call · #0238–#0238

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

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

    1 call · #0239–#0239

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

    Requested source searches related to rollout generation.

    1 call · #0240–#0240

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

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

    3 calls · #0241–#0243

    rg -n <val> <path>head -n <n>tail -n <n> <path>cut -c <val>rg --files <path>rg <path>
  192. Inspect · Rollout generation

    Requested file and log inspection related to rollout generation.

    1 call · #0244–#0244

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

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

    4 calls · #0245–#0248

    rg -n <val> <path>head -n <n>sed -n <val> <path>rg -n <val> <path> <path>rg --files <path>rg <val>
  194. Inspect · Rollout generation

    Requested file and log inspection related to rollout generation.

    1 call · #0249–#0249

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

    Requested file and log inspection related to source & workspace.

    1 call · #0250–#0250

    tail -n <n> <path>cut -c <val>
  196. Inspect · Rollout generation

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

    1 call · #0251–#0251

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

    Requested code edits related to rollout generation.

    1 call · #0252–#0252

    Apply patch <patch>
  198. Validate · Checkpoints & weight state

    Requested script or workload execution related to checkpoints & weight state.

    1 call · #0253–#0253

    python - <script>bash <script> > <path> <n> >& <path>
  199. Other · Rollout generation

    Requested tool activity related to rollout generation.

    1 call · #0254–#0254

    <command> <args>
  200. Inspect · Source & workspace

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

    2 calls · #0255–#0256

    tail -n <n> <path>cut -c <val>rg --files <val>rg <val>head -n <n>
  201. Other · Rollout generation

    Requested tool activity related to rollout generation.

    1 call · #0257–#0257

    <command> <args>
  202. Execute · Rollout generation

    Requested script or workload execution related to rollout generation.

    1 call · #0258–#0258

    python - <script>
  203. Inspect · Runtime processes

    Requested file and log inspection related to runtime processes.

    1 call · #0259–#0259

    cat <path>
  204. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0260–#0260

    tail -n <n> <path>
  205. Validate · Checkpoints & weight state

    Requested script or workload execution related to checkpoints & weight state.

    1 call · #0261–#0261

    python - <script>
  206. Execute · Rollout generation

    Requested script or workload execution related to rollout generation.

    1 call · #0262–#0262

    python - <script>
  207. Validate · Attention kernels

    1 tool error

    Requested file and log inspection and script or workload execution related to attention kernels.

    1 call · #0263–#0263

    cat > <path> <script>python -m <module> <script> -q > <path> <n> >& <path>
  208. Inspect · Runtime processes

    Requested file and log inspection related to runtime processes.

    1 call · #0264–#0264

    cat <path>tail -n <n> <path>
  209. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0265–#0265

    tail -n <n> <path>
  210. Validate · Benchmark & validation setup

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

    1 call · #0266–#0266

    python - <script>
  211. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0267–#0267

    sed -n <val> <path>
  212. Execute · Rollout generation

    Requested script or workload execution related to rollout generation.

    1 call · #0268–#0268

    python - <script>
  213. Inspect · Runtime processes

    Requested file and log inspection related to runtime processes.

    1 call · #0269–#0269

    tail -n <n> <path>
  214. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0270–#0270

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

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

    1 call · #0271–#0271

    python - <script>env <vars> python -m <module> <script> -q > <path> <n> >& <path>
  216. Inspect · Source & workspace

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

    3 calls · #0272–#0274

    tail -n <n> <path>ps <flag> <args>head -n <n>cut -c <val>sed -n <val> <path>
  217. Inspect · Benchmark & validation setup

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

    1 call · #0275–#0275

    tail -n <n> <path>cut -c <val>
  218. Inspect · Source & workspace

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

    5 calls · #0276–#0280

    git diff --checkgit status --shortsed -n <val> <path>
  219. Inspect · Runtime processes

    Requested file and log inspection related to runtime processes.

    1 call · #0281–#0281

    sed -n <val> <path>
  220. Inspect · Benchmark & validation setup

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

    1 call · #0282–#0282

    rg -n <val> <path>head -n <n>
  221. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0283–#0283

    Apply patch <patch>
  222. Validate · Benchmark & validation setup

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

    1 call · #0284–#0284

    python -m <module> <script> -q -k <val> > <path> <n> >& <path>
  223. Inspect · Benchmark & validation setup

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

    1 call · #0285–#0285

    tail -n <n> <path>cut -c <val>
  224. Inspect · Runtime processes

    Requested file and log inspection related to runtime processes.

    1 call · #0286–#0286

    tail -n <n> <path>
  225. Inspect · Source & workspace

    Requested repository inspection related to source & workspace.

    1 call · #0287–#0287

    git diff --numstat
  226. Inspect · Benchmark & validation setup

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

    2 calls · #0288–#0289

    tail -n <n> <path>cut -c <val>
  227. Inspect · Source & workspace

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

    1 call · #0290–#0290

    ps <flag> <args>head -n <n>cut -c <val>
  228. Build · Runtime processes

    Requested script or workload execution related to runtime processes.

    1 call · #0291–#0291

    python - <script>
  229. Other · KV-cache management

    Requested tool activity related to kv-cache management.

    1 call · #0292–#0292

    <command> <args>
  230. Other · Rollout generation

    Requested tool activity related to rollout generation.

    1 call · #0293–#0293

    <command> <args>
  231. Build · Source & workspace

    Requested environment setup or inspection related to source & workspace.

    1 call · #0294–#0294

    env <vars> make <val> > <path> <n> >& <path>
  232. Inspect · Benchmark & validation setup

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

    1 call · #0295–#0295

    tail -n <n> <path>cut -c <val>
  233. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0296–#0296

    tail -n <n> <path>
  234. Inspect · Benchmark & validation setup

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

    1 call · #0297–#0297

    tail -n <n> <path>cut -c <val>
  235. Inspect · Source & workspace

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

    1 call · #0298–#0298

    ps <flag> <args>head -n <n>cut -c <val>
  236. Inspect · Benchmark & validation setup

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

    1 call · #0299–#0299

    rg -n <val> <path>tail -n <n>
  237. Inspect · Source & workspace

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

    1 call · #0300–#0300

    rg --files <path>rg <val>tail -n <n>
  238. Inspect · Benchmark & validation setup

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

    1 call · #0301–#0301

    tail -n <n> <path>cut -c <val>
  239. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0302–#0302

    python - <script>
  240. Inspect · Benchmark & validation setup

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

    1 call · #0303–#0303

    tail -n <n> <path>cut -c <val>
  241. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0304–#0304

    python - <script>
  242. Execute · Benchmark & validation setup

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

    1 call · #0305–#0305

    kill <flag> <args>bash <script> > <path> <n> >& <path>
  243. Inspect · Benchmark & validation setup

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

    1 call · #0306–#0306

    tail -n <n> <path>cut -c <val>
  244. Execute · Benchmark & validation setup

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

    1 call · #0307–#0307

    python - <script>
  245. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0308–#0308

    tail -n <n> <path>
  246. Inspect · Benchmark & validation setup

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

    2 calls · #0309–#0310

    tail -n <n> <path>cut -c <val>
  247. Inspect · Source & workspace

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

    2 calls · #0311–#0312

    tail -n <n> <path>ps -o <val> -p <n> <flag> <args>
  248. Inspect · Benchmark & validation setup

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

    1 call · #0313–#0313

    tail -n <n> <path>cut -c <val>
  249. Other · Source & workspace

    Requested environment setup or inspection related to source & workspace.

    1 call · #0314–#0314

    env <vars> python <script> <flag> <args>
  250. Inspect · Benchmark & validation setup

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

    1 call · #0315–#0315

    tail -n <n> <path>cut -c <val>
  251. Inspect · Source & workspace

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

    2 calls · #0316–#0317

    tail -n <n> <path>rg -n <val> <path>git diff --checkgit status --short
  252. Inspect · Benchmark & validation setup

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

    2 calls · #0318–#0319

    tail -n <n> <path>cut -c <val>
  253. Validate · Checkpoints & weight state

    Requested script or workload execution related to checkpoints & weight state.

    1 call · #0320–#0320

    python - <script>
  254. Inspect · Benchmark & validation setup

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

    1 call · #0321–#0321

    tail -n <n> <path>cut -c <val>
  255. Validate · Checkpoints & weight state

    Requested script or workload execution related to checkpoints & weight state.

    1 call · #0322–#0322

    python - <script>
  256. Validate · Device memory

    Requested script or workload execution related to device memory.

    1 call · #0323–#0323

    python - <script>
  257. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    3 calls · #0324–#0326

    tail -n <n> <path>cut -c <val>
  258. Inspect · Batching & scheduling

    Requested source searches and file and log inspection related to batching & scheduling.

    1 call · #0327–#0327

    rg -n <val> <path>tail -n <n>
  259. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    3 calls · #0328–#0330

    tail -n <n> <path>cut -c <val>
  260. Validate · Benchmark & validation setup

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

    1 call · #0331–#0331

    python - <script>kill <flag> <args>bash <script> > <path> <n> >& <path>
  261. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0332–#0332

    tail -n <n> <path>cut -c <val>
  262. Validate · Checkpoints & weight state

    Requested script or workload execution related to checkpoints & weight state.

    1 call · #0333–#0333

    python - <script>
  263. Inspect · Benchmark & validation setup

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

    7 calls · #0334–#0340

    tail -n <n> <path>cut -c <val>
  264. Validate · Benchmark & validation setup

    1 tool error

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

    1 call · #0341–#0341

    bash <script> > <path> <n> >& <path>
  265. Validate · Reward & policy updates

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

    1 call · #0342–#0342

    python - <script>
  266. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0343–#0343

    bash <script> > <path> <n> >& <path>
  267. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0344–#0344

    cat <path>
  268. Validate · Reward & policy updates

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

    1 call · #0345–#0345

    python - <script>
  269. Build · Dependencies & build setup

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

    1 call · #0346–#0346

    python - <script>
  270. Validate · Reward & policy updates

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

    1 call · #0347–#0347

    python - <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/integrations/npu_flash_attention.py b/src/transformers/integrations/npu_flash_attention.pyindex f4c4e98da9b3b7248aed9626bff9cec7fc947ca5..c93187f95152c2509352aec7dd1a316a3ce893f4 100644--- a/src/transformers/integrations/npu_flash_attention.py+++ b/src/transformers/integrations/npu_flash_attention.py@@ -96,11 +96,28 @@ def npu_flash_attn_varlen_func(     causal=False,     **kwargs, ):+    """Variable-length attention with tensor or host-side cumulative lengths.++    Host sequences let callers prepare the metadata once and reuse it across+    layers without a device-to-host synchronization for each attention call.+    """     keep_prob = 1.0 - dropout_p      if softmax_scale is None:         softmax_scale = 1.0 / math.sqrt(q.shape[-1]) +    actual_seq_qlen = (+        tuple(cu_seqlens_q[1:].cpu().tolist()) if isinstance(cu_seqlens_q, torch.Tensor) else tuple(cu_seqlens_q[1:])+    )+    if cu_seqlens_k is cu_seqlens_q:+        actual_seq_kvlen = actual_seq_qlen+    else:+        actual_seq_kvlen = (+            tuple(cu_seqlens_k[1:].cpu().tolist())+            if isinstance(cu_seqlens_k, torch.Tensor)+            else tuple(cu_seqlens_k[1:])+        )+     if not causal:         head_num = q.shape[1]         output = npu_fusion_attention(@@ -113,8 +130,8 @@ def npu_flash_attn_varlen_func(             scale=softmax_scale,             keep_prob=keep_prob,             input_layout="TND",-            actual_seq_qlen=tuple(cu_seqlens_q[1:].cpu().numpy().tolist()),-            actual_seq_kvlen=tuple(cu_seqlens_k[1:].cpu().numpy().tolist()),+            actual_seq_qlen=actual_seq_qlen,+            actual_seq_kvlen=actual_seq_kvlen,         )[0]     else:         attn_mask_npu = get_attn_mask_npu(q.device)@@ -130,8 +147,8 @@ def npu_flash_attn_varlen_func(             scale=softmax_scale,             keep_prob=keep_prob,             input_layout="TND",-            actual_seq_qlen=tuple(cu_seqlens_q[1:].cpu().numpy().tolist()),-            actual_seq_kvlen=tuple(cu_seqlens_k[1:].cpu().numpy().tolist()),+            actual_seq_qlen=actual_seq_qlen,+            actual_seq_kvlen=actual_seq_kvlen,             sparse_mode=SPARSE_MODE,         )[0] diff --git a/src/transformers/modeling_flash_attention_utils.py b/src/transformers/modeling_flash_attention_utils.pyindex 207d4ab1790c1eee6b0508650795eb1e9a809b82..1e1c6dc3140d83de3d59a97fb9726c387b868e9b 100644--- a/src/transformers/modeling_flash_attention_utils.py+++ b/src/transformers/modeling_flash_attention_utils.py@@ -479,6 +479,9 @@ class FlashAttentionKwargs(TypedDict, total=False):     """     Keyword arguments for Flash Attention with Compile. +    On NPU, cumulative lengths may also be tuples of integers, allowing host+    metadata to be reused across layers without device-to-host transfers.+     Attributes:         cu_seq_lens_q (`torch.LongTensor`, *optional*)             Gets cumulative sequence length for query state.@@ -490,8 +493,8 @@ class FlashAttentionKwargs(TypedDict, total=False):             Maximum sequence length for key state.     """ -    cu_seq_lens_q: torch.LongTensor | None-    cu_seq_lens_k: torch.LongTensor | None+    cu_seq_lens_q: torch.LongTensor | tuple[int, ...] | None+    cu_seq_lens_k: torch.LongTensor | tuple[int, ...] | None     max_length_q: int | None     max_length_k: int | None @@ -585,8 +588,8 @@ def _flash_attention_forward(     use_top_left_mask: bool = False,     softcap: float | None = None,     deterministic: bool | None = None,-    cu_seq_lens_q: torch.LongTensor | None = None,-    cu_seq_lens_k: torch.LongTensor | None = None,+    cu_seq_lens_q: torch.LongTensor | tuple[int, ...] | None = None,+    cu_seq_lens_k: torch.LongTensor | tuple[int, ...] | None = None,     max_length_q: int | None = None,     max_length_k: int | None = None,     target_dtype: torch.dtype | None = None,@@ -642,10 +645,16 @@ def _flash_attention_forward(     #     # NOTE: it is user's responsibility to take care of flattening `position_ids` if that's needed by the model.     # See #39121 for more information.-    is_fa_with_position_ids = _is_packed_sequence(position_ids, batch_size=query_states.size(0))     is_fa_with_varlen_kwargs = all(         kwarg is not None for kwarg in (cu_seq_lens_q, cu_seq_lens_k, max_length_q, max_length_k)     )+    # Explicit lengths already describe the packing. Avoid inspecting device-side+    # position IDs again in every layer (and during checkpoint recomputation).+    is_fa_with_position_ids = (+        attention_mask is None+        and not is_fa_with_varlen_kwargs+        and _is_packed_sequence(position_ids, batch_size=query_states.size(0))+    )      # Contains at least one padding token in the sequence     if attention_mask is not None:
verl · 6 changed files

Base commit: 0b2151ec61de5d99e0811b01c09e43a99a23e69d

diff --git a/verl/utils/npu_flash_attn_utils.py b/verl/utils/npu_flash_attn_utils.pyindex eb31a304040d14abbf0cb7d050816d9d9c51c7cd..bbfb05397f82631efc095a2e78698440ce59b88d 100644--- a/verl/utils/npu_flash_attn_utils.py+++ b/verl/utils/npu_flash_attn_utils.py@@ -18,6 +18,32 @@ import torch.nn.functional as F from einops import rearrange, repeat  +def prepare_npu_fa_kwargs(position_ids: torch.Tensor) -> dict:+    """Prepare packed attention lengths on the host before moving a batch to NPU.++    The NPU attention operator consumes host sequence lengths. Tuples also keep+    FSDP's input placement from moving this metadata to the device. Derive the+    boundaries from position IDs, rather than sample lengths, so a sample may+    itself contain multiple packed sequences.+    """+    if position_ids.device.type != "cpu" or position_ids.ndim != 2:+        return {}++    positions = position_ids.values() if position_ids.is_nested else position_ids.reshape(-1)+    starts = (positions == 0).nonzero().flatten()+    if starts.numel() <= 1:+        return {}++    cu_seqlens = (*starts.tolist(), positions.numel())+    max_length = max(end - start for start, end in zip(cu_seqlens[:-1], cu_seqlens[1:], strict=True))+    return {+        "cu_seq_lens_q": cu_seqlens,+        "cu_seq_lens_k": cu_seqlens,+        "max_length_q": max_length,+        "max_length_k": max_length,+    }++ # Copied from https://github.com/Dao-AILab/flash-attention/blob/main/flash_attn/bert_padding.py class IndexFirstAxis(torch.autograd.Function):     @staticmethoddiff --git a/verl/utils/optimizers.py b/verl/utils/optimizers.pynew file mode 100644index 0000000000000000000000000000000000000000..1c8bf9bb208fdc3f58532acb5d62d69ddbce86fb--- /dev/null+++ b/verl/utils/optimizers.py@@ -0,0 +1,47 @@+# Copyright 2026 The verl team+#+# 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.++import torch+from torch.distributed.tensor import DTensor+++class LocalShardAdamW(torch.optim.AdamW):+    """Use native AdamW kernels for DTensors on a one-rank device mesh.++    On a one-rank mesh, the local tensor is the entire parameter. Passing its+    view to AdamW avoids distributed dispatch for every pointwise operation and+    lets PyTorch select foreach kernels on supported devices. Parameter groups+    and optimizer state still contain the original DTensors, preserving FSDP+    checkpoint save/load and the normal AdamW state dictionary.+    """++    def _init_group(self, group, *args, **kwargs):+        # Older PyTorch versions pass an additional amsgrad flag here. Forward+        # the original signature and only unwrap the temporary tensor lists.+        has_complex = super()._init_group(group, *args, **kwargs)+        tensor_lists = [value for value in (*args, *kwargs.values()) if isinstance(value, list)]+        if group["differentiable"] or any(+            isinstance(tensor, DTensor) and tensor.device_mesh.size() != 1+            for tensors in tensor_lists+            for tensor in tensors+        ):+            return has_complex++        # Only the temporary argument lists are changed. to_local() shares+        # storage, so native in-place updates also update the saved DTensors.+        for tensors in tensor_lists:+            for index, tensor in enumerate(tensors):+                if isinstance(tensor, DTensor):+                    tensors[index] = tensor.to_local()+        return has_complexdiff --git a/verl/utils/ray_utils.py b/verl/utils/ray_utils.pyindex eff3d91085f8ec84a97e0b0b1d14692eb4ee5b76..3ec199d1a01174849d2d30ddafa0caa95b591c3a 100644--- a/verl/utils/ray_utils.py+++ b/verl/utils/ray_utils.py@@ -25,6 +25,77 @@ from typing import Any, Optional import ray  +def create_lazy_actor(actor_cls: type) -> type:+    """Defer an actor's implementation imports until its constructor runs.++    Ray deserializes an actor's class even in processes that only receive its+    handle. A routing worker therefore needlessly imports an entire inference+    backend when handed a server handle. This proxy serializes only method+    signatures and an import path; the server process constructs the original+    implementation and runs all calls on that same instance.++    Supports importable classes with ordinary synchronous or asynchronous+    instance methods. Streaming methods must use the original actor class.+    """+    module_name, class_name = actor_cls.__module__, actor_cls.__qualname__+    if "<locals>" in class_name:+        raise ValueError("Lazy actors must be defined at module scope")++    # Local classes and functions are serialized by value. Handle holders can+    # reconstruct this proxy without importing Verl or the inference backend.+    class LazyActor:+        def __init__(self, *args, **kwargs):+            import importlib++            implementation = importlib.import_module(module_name)+            for name in class_name.split("."):+                implementation = getattr(implementation, name)+            self._implementation = implementation(*args, **kwargs)++        def __getattr__(self, name):+            return getattr(self._implementation, name)++    def forward_method(name, asynchronous):+        if asynchronous:++            async def method(self, *args, **kwargs):+                return await getattr(self._implementation, name)(*args, **kwargs)++        else:++            def method(self, *args, **kwargs):+                return getattr(self._implementation, name)(*args, **kwargs)++        return method++    for name, original in inspect.getmembers(actor_cls, inspect.isfunction):+        if name.startswith("__") and name != "__init__":+            continue+        if inspect.isgeneratorfunction(original) or inspect.isasyncgenfunction(original):+            raise ValueError(f"Lazy actors do not support streaming method {name}")+        method = (+            LazyActor.__init__ if name == "__init__" else forward_method(name, inspect.iscoroutinefunction(original))+        )+        method.__name__ = name+        method.__doc__ = original.__doc__+        # Ray needs argument binding, not type annotations. Backend types in+        # annotations would otherwise bring back the imports this proxy avoids.+        signature = inspect.signature(original)+        method.__signature__ = signature.replace(+            parameters=[+                parameter.replace(annotation=inspect.Parameter.empty) for parameter in signature.parameters.values()+            ],+            return_annotation=inspect.Signature.empty,+        )+        # Preserve Ray's per-method options, such as concurrency groups.+        method.__dict__.update({key: value for key, value in vars(original).items() if key.startswith("__ray_")})+        setattr(LazyActor, name, method)++    LazyActor.__name__ = actor_cls.__name__+    LazyActor.__doc__ = actor_cls.__doc__+    return LazyActor++ def ray_noset_visible_devices(env_vars=os.environ):     # Refer to     # https://github.com/ray-project/ray/blob/161849364a784442cc659fb9780f1a6adee85fce/python/ray/_private/accelerators/nvidia_gpu.py#L95-L96diff --git a/verl/workers/config/optimizer.py b/verl/workers/config/optimizer.pyindex 47afdd3bf2e14ca1be39d14720775284d92d19a4..55e2cb25a480a9741f24383aa54d0319dec995d6 100644--- a/verl/workers/config/optimizer.py+++ b/verl/workers/config/optimizer.py@@ -268,4 +268,12 @@ def build_optimizer(parameters, config: FSDPOptimizerConfig):             f"Available optimizers: {dir(module)}"         ) from e +    if config.optimizer_impl == "torch.optim" and config.optimizer == "AdamW":+        from verl.utils.device import get_device_name++        if get_device_name() == "npu":+            from verl.utils.optimizers import LocalShardAdamW++            optimizer_cls = LocalShardAdamW+     return optimizer_cls(parameters, **optimizer_args)diff --git a/verl/workers/engine/fsdp/transformer_impl.py b/verl/workers/engine/fsdp/transformer_impl.pyindex 2218d6dfc81186e63766d435056dfe75963a3d69..a8ab8c981d93d6872c2962013b0637b5071dc66e 100644--- a/verl/workers/engine/fsdp/transformer_impl.py+++ b/verl/workers/engine/fsdp/transformer_impl.py@@ -1260,9 +1260,21 @@ class FSDPEngineWithLMHead(FSDPEngine):      def forward_step(self, micro_batch: TensorDict, loss_function, forward_only):         device_name = get_device_name()+        attention_kwargs = {}+        if (+            device_name == "npu"+            and tu.get_non_tensor_data(micro_batch, "use_remove_padding", default=True)+            and not self.use_ulysses_sp+            and getattr(self.module.config, "_attn_implementation", None) == "flash_attention_2"+        ):+            from verl.utils.npu_flash_attn_utils import prepare_npu_fa_kwargs++            attention_kwargs = prepare_npu_fa_kwargs(micro_batch["position_ids"])+         # actually, we should avoid assigning like this...         micro_batch = micro_batch.to(get_device_id())         model_inputs, output_args = self.prepare_model_inputs(micro_batch=micro_batch)+        model_inputs.update(attention_kwargs)          # Honor mixed_precision.param_dtype resolved during FSDP setup. When dtype is fp32,         # autocast is a no-op at best and a footgun at worst, so skip it entirely.diff --git a/verl/workers/rollout/vllm_rollout/vllm_async_server.py b/verl/workers/rollout/vllm_rollout/vllm_async_server.pyindex 962cf1fb5579f4dd7e4d857ac447544c532ec1ab..93308ad8ca08acd91011ab049b86fd6333f903c9 100644--- a/verl/workers/rollout/vllm_rollout/vllm_async_server.py+++ b/verl/workers/rollout/vllm_rollout/vllm_async_server.py@@ -38,6 +38,7 @@ from verl.utils.config import omega_conf_to_dataclass from verl.utils.device import get_resource_name, get_visible_devices_keyword, is_torch_npu_available from verl.utils.net_utils import get_free_port, is_valid_ipv6_address from verl.utils.profiler import DistProfiler, build_vllm_profiler_args+from verl.utils.ray_utils import create_lazy_actor from verl.utils.tokenizer import normalize_token_ids from verl.utils.vllm.vllm_fp8_utils import apply_vllm_fp8_patches from verl.workers.config import HFModelConfig, RolloutConfig@@ -237,7 +238,13 @@ class vLLMHttpServer:         compilation_config = engine_kwargs.pop("compilation_config", None) or {}         if isinstance(compilation_config, str):             compilation_config = json.loads(compilation_config)-        compilation_config.setdefault("cudagraph_mode", "FULL_AND_PIECEWISE")+        # Ascend falls back from FULL_AND_PIECEWISE to per-layer piecewise+        # graphs. A single-device colocated engine can use its full decode+        # graph support, avoiding Python dispatch between every decoder layer.+        default_graph_mode = "FULL_AND_PIECEWISE"+        if self._is_single_device_npu() and _VLLM_VERSION >= version.parse("0.18.0"):+            default_graph_mode = "FULL_DECODE_ONLY"+        compilation_config.setdefault("cudagraph_mode", default_graph_mode)          # FULL cuda graph is not yet supported with DCP, downgrade to PIECEWISE         dcp_size = engine_kwargs.get("decode_context_parallel_size", 1) or 1@@ -387,6 +394,7 @@ class vLLMHttpServer:         usage_context = UsageContext.OPENAI_API_SERVER         vllm_config = engine_args.create_engine_config(usage_context=usage_context)         vllm_config.parallel_config.data_parallel_master_port = self._dp_master_port+        self._limit_colocated_kv_cache(vllm_config)          fn_args = set(dict(inspect.signature(AsyncLLM.from_vllm_config).parameters).keys())         kwargs = {}@@ -430,6 +438,44 @@ class vLLMHttpServer:         self.engine = engine_client         self._server_port, self._server_task = await run_uvicorn(app, args, self._server_address) +    def _is_single_device_npu(self) -> bool:+        return (+            self.rollout_mode == RolloutMode.HYBRID+            and self.nnodes == 1+            and len(self.workers) == 1+            and is_torch_npu_available(check_device=False)+        )++    def _limit_colocated_kv_cache(self, vllm_config):+        """Avoid repeatedly releasing an oversized cache between actor updates.++        For a uniform full-attention cache, one block per maximum-length+        request segment plus the allocator's null block is enough to run every+        scheduled request concurrently. The block limit still respects vLLM's+        profiled memory budget, and explicit cache sizing takes precedence.+        """+        if not self._is_single_device_npu() or not self.config.free_cache_engine:+            return+        model = vllm_config.model_config+        cache = vllm_config.cache_config+        if (+            not hasattr(cache, "max_num_gpu_blocks")+            or cache.max_num_gpu_blocks is not None+            or cache.num_gpu_blocks_override is not None+            or cache.kv_cache_memory_bytes is not None+            or model.is_hybrid+            or model.is_attention_free+            or model.is_encoder_decoder+            or model.is_multimodal_model+            or model.get_sliding_window() is not None+            or vllm_config.speculative_config is not None+            or vllm_config.kv_transfer_config is not None+        ):+            return+        blocks_per_request = (model.max_model_len + cache.block_size - 1) // cache.block_size+        cache.max_num_gpu_blocks = 1 + vllm_config.scheduler_config.max_num_seqs * blocks_per_request+        logger.info("Limiting colocated rollout KV cache to %d blocks", cache.max_num_gpu_blocks)+     async def run_headless(self, args: argparse.Namespace):         """Run headless server in a separate thread."""         args.api_server_count = 0@@ -963,7 +1009,7 @@ class vLLMReplica(RolloutReplica):         super().__init__(             replica_rank, config, model_config, gpus_per_node, is_reward_model, is_teacher_model, name_suffix         )-        self.server_class = ray.remote(vLLMHttpServer)+        self.server_class = ray.remote(create_lazy_actor(vLLMHttpServer))      async def launch_servers(self):         """Launch http server in each node."""
vllm · 2 changed files

Base commit: 5a0277de14789b245c781911b3119ed6af901b7b

diff --git a/vllm/config/cache.py b/vllm/config/cache.pyindex f4c70cace2641bc3adee5508fca3775923eaf9ce..d0d30ea32537b4b3432118daa15c20dc47f2a466 100644--- a/vllm/config/cache.py+++ b/vllm/config/cache.py@@ -60,6 +60,12 @@ class CacheConfig:     num_gpu_blocks_override: int | None = None     """Number of GPU blocks to use. This overrides the profiled `num_gpu_blocks`     if specified. Does nothing if `None`. Used for testing preemption."""+    max_num_gpu_blocks: int | None = Field(default=None, gt=0)+    """Optional upper bound on the profiled number of GPU cache blocks.+    Unlike `num_gpu_blocks_override`, this never increases the allocation above+    the memory budget. Useful for engines that frequently release their cache+    and only need enough blocks for a bounded batch of requests. An explicit+    `num_gpu_blocks_override` takes precedence over this limit."""     sliding_window: int | None = None     """Sliding window size for the KV cache. This is primarily set in     `ModelConfig` and that value should be manually duplicated here."""@@ -166,6 +172,7 @@ class CacheConfig:             "gpu_memory_utilization",             "is_attention_free",             "num_gpu_blocks_override",+            "max_num_gpu_blocks",             "enable_prefix_caching",             "prefix_caching_hash_algo",             "cpu_kvcache_space_bytes",diff --git a/vllm/v1/core/kv_cache_utils.py b/vllm/v1/core/kv_cache_utils.pyindex 3da3d7e7bef720d2223976cdad4506c04b7916fa..4b84cad762ae514d0b55a46efd7b5a7cc2734fbe 100644--- a/vllm/v1/core/kv_cache_utils.py+++ b/vllm/v1/core/kv_cache_utils.py@@ -819,7 +819,7 @@ def get_max_concurrency_for_kv_cache_config(  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.+    Apply the cache allocation limit or an explicit block-count override.     """     if vllm_config.cache_config.num_gpu_blocks_override is not None:         num_gpu_blocks_override = vllm_config.cache_config.num_gpu_blocks_override@@ -829,6 +829,8 @@ def may_override_num_blocks(vllm_config: VllmConfig, num_blocks: int) -> int:             num_gpu_blocks_override,         )         num_blocks = num_gpu_blocks_override+    elif vllm_config.cache_config.max_num_gpu_blocks is not None:+        num_blocks = min(num_blocks, vllm_config.cache_config.max_num_gpu_blocks)      return num_blocks