GPT-6 Astra · Training

T01 · DP2

Valid

Qwen3-4B CodeOpt DP2 training 2dev · Implementation Optimization

1.09×PERFORMANCE RATIO
342TOOL EVENTS
2TEXT 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 · 342 visible calls

InspectEditValidateExecuteBuildProfileRollbackOther
262Inspect
8Edit
32Validate
9Execute
17Profile
14Other

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 timeline261 groups · 342 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

    2 tool errors

    Requested workspace inspection, environment setup or inspection and source searches related to task requirements.

    7 calls · #0001–#0007

    pwdprintenv <vars>rg --files -g <val> -g <val> -g <val> <path> <n> > <path><command> <args>cat <val>cat <path> <path>
    6 more command sketches
    git status --shortrg --files --hidden -g <val> -g <val> -g <val> -g <val> -g <val> <args>head -n <n>cat <path> <path> <path>rg --files <path> <path> <path>rg --files --hidden <val> <path> <path> -g <val>
  2. Inspect · Benchmark & validation setup

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

    2 calls · #0008–#0009

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

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

    2 calls · #0010–#0011

    sed -n <val> <path>cat <path>rg --files <val> <path> <path>head -n <n>printenv <vars>
  4. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0012–#0012

    bash <script>
  5. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0013–#0013

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

    Requested source searches related to optimizer & gradients.

    1 call · #0014–#0014

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

    1 tool error

    Requested file and log inspection related to source & workspace.

    1 call · #0015–#0015

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

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

    1 call · #0016–#0016

    tail -n <n> <path>rg -n <val> <val>npu-smi info
  9. Inspect · Parallelism & communication

    Requested file and log inspection and source searches related to parallelism & communication.

    1 call · #0017–#0017

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

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

    1 call · #0018–#0018

    tail -n <n> <path>ps <flag> <args>rg <val>head -n <n>
  11. Inspect · Parallelism & communication

    Requested file and log inspection related to parallelism & communication.

    1 call · #0019–#0019

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

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

    1 call · #0020–#0020

    cat <path>rg -n <val> <path> <val> <n> > <path>head -n <n>
  13. Inspect · Parallelism & communication

    1 tool error

    Requested file and log inspection and source searches related to parallelism & communication.

    1 call · #0021–#0021

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

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

    1 call · #0022–#0022

    rg -n <val> <path> -g <path> -g <val> -g <val>head -n <n>rg --files <path>
  15. Inspect · Parallelism & communication

    Requested file and log inspection related to parallelism & communication.

    1 call · #0023–#0023

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

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

    1 call · #0024–#0024

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

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

    2 calls · #0025–#0026

    cat <path>rg --files <path>sed -n <val> <path>rg -n <val> <path> <path> -g <path>
  18. Inspect · Benchmark & validation setup

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

    1 call · #0027–#0027

    tail -n <n> <path>du <flag> <args>
  19. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    2 calls · #0028–#0029

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

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

    1 call · #0030–#0030

    tail -n <n> <path>df -h <path> <path>
  21. Inspect · Parallelism & communication

    Requested source searches and file and log inspection related to parallelism & communication.

    1 call · #0031–#0031

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

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

    1 call · #0032–#0032

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

    Requested file and log inspection related to attention kernels.

    1 call · #0033–#0033

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

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

    1 call · #0034–#0034

    tail -n <n> <path>npu-smi info
  25. Inspect · Attention kernels

    1 tool error

    Requested file and log inspection related to attention kernels.

    1 call · #0035–#0035

    cat <path>
  26. Inspect · Checkpoints & weight state

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

    1 call · #0036–#0036

    tail -n <n> <path>du <flag> <args>
  27. Inspect · Benchmark & validation setup

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

    1 call · #0037–#0037

    tail -n <n> <path>free -hps -o <val> -p <val>
  28. Inspect · Checkpoints & weight state

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

    1 call · #0038–#0038

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

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

    1 call · #0039–#0039

    tail -n <n> <path>tail -n <n> <path> <n> > <path>du <flag> <args>
  30. Inspect · Parallelism & communication

    Requested file and log inspection and source searches related to parallelism & communication.

    1 call · #0040–#0040

    sed -n <val> <path>rg -n <val> <path> <path> -g <path>
  31. Profile · Checkpoints & weight state

    1 tool error

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

    1 call · #0041–#0041

    rg -n <val> <path>head -n <n>cat <path> <path>du <flag> <args>command -v <val> <val>
  32. Inspect · Source & workspace

    1 tool error

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

    1 call · #0042–#0042

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

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

    1 call · #0043–#0043

    cat <path>rg -n <val> <val> -g <path>head -n <n>
  34. Validate · Checkpoints & weight state

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

    2 calls · #0044–#0045

    tail -n <n> <path>tail -n <n> <path> <n> > <path>du <flag> <args><command> <args>rg <val>head -n <n>
    2 more command sketches
    ps -L -p <n> -o <val>sort <flag> <args>
  35. Inspect · Checkpoints & weight state

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

    1 call · #0046–#0046

    du <flag> <args>stat -c <val> <path>cat <path> <path>rg -n <val> <path>head -n <n>
  36. Inspect · Device memory

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

    1 call · #0047–#0047

    command -v <val>cat <path>top -b -n <n> -d <n> -p <val>tail -n <n>
  37. Validate · Checkpoints & weight state

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

    1 call · #0048–#0048

    tail -n <n> <path>tail -n <n> <path> <n> > <path>du <flag> <args>
  38. Inspect · Attention kernels

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

    1 call · #0049–#0049

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

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

    1 call · #0050–#0050

    tail -n <n> <path>tail -n <n> <path> <n> > <path>du <flag> <args>
  40. Inspect · Checkpoints & weight state

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

    1 call · #0051–#0051

    tail -n <n> <path>du <flag> <args>rg --files <val> -g <val> -g <val>
  41. Validate · Checkpoints & weight state

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

    1 call · #0052–#0052

    tail -n <n> <path>tail -n <n> <path> <n> > <path>du <flag> <args>
  42. Inspect · Optimizer & gradients

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

    1 call · #0053–#0053

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

    Requested file and log inspection related to source & workspace.

    1 call · #0054–#0054

    sed -n <val> <path>
  44. Validate · Checkpoints & weight state

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

    1 call · #0055–#0055

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

    Requested file and log inspection related to optimizer & gradients.

    1 call · #0056–#0056

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

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

    2 calls · #0057–#0058

    tail -n <n> <path> <n> > <path>tail -n <n> <path>ps <flag> <args>rg <path>cut <flag>head -n <n>
  47. Inspect · Attention kernels

    1 tool error

    Requested source searches related to attention kernels.

    1 call · #0059–#0059

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

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

    2 calls · #0060–#0061

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

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

    1 call · #0062–#0062

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

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

    1 call · #0063–#0063

    bash <script> > <path> <n> > <path>
  51. Validate · Checkpoints & weight state

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

    1 call · #0064–#0064

    python3 - <script>
  52. Inspect · Source & workspace

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

    1 call · #0065–#0065

    rg --files <val>rg <path>head -n <n>cat <path> <path>sed -n <val> <path>
  53. Execute · Benchmark & validation setup

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

    1 call · #0066–#0066

    tail -n <n> <path> <n> > <path>git status --shortgit -C <path> <val> --short
  54. Inspect · Source & workspace

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

    1 call · #0067–#0067

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

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

    1 call · #0068–#0068

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

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

    1 call · #0069–#0069

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

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

    1 call · #0070–#0070

    cat <path> <path>rg -n <val> <path> <path>
  58. Execute · Benchmark & validation setup

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

    2 calls · #0071–#0072

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

    Requested file and log inspection related to source & workspace.

    1 call · #0073–#0073

    cat <path> <n> > <path>sed -n <val> <path>
  60. Execute · Benchmark & validation setup

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

    1 call · #0074–#0074

    tail -n <n> <path> <n> > <path>rg -n <val> <path> <n> > <path>tail -n <n>
  61. Inspect · Parallelism & communication

    Requested source searches and file and log inspection related to parallelism & communication.

    1 call · #0075–#0075

    rg -n <val> <path> <path>head -n <n>rg -n <val> <path>
  62. Inspect · Runtime processes

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

    1 call · #0076–#0076

    tail -n <n> <path>sed -n <val> <path>rg -n <val> <path> <path>tail -n <n>
  63. Execute · Benchmark & validation setup

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

    1 call · #0077–#0077

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

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

    1 call · #0078–#0078

    rg <val> <path>tail -n <n>du <flag> <args>wc -c <path>
  65. Inspect · Source & workspace

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

    1 call · #0079–#0079

    cat <path>rg -n <val> <path>sed -n <val> <path>
  66. Execute · Benchmark & validation setup

    1 tool error

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

    1 call · #0080–#0080

    rg <val> <path>tail -n <n>tail -n <n> <path>ls -l -h <path> <n> > <path>
  67. Validate · Benchmark & validation setup

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

    1 call · #0081–#0081

    python3 - <script>
  68. Profile · Benchmark & validation setup

    1 tool error

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

    1 call · #0082–#0082

    tail -n <n> <path>tail -n <n> <path> <n> > <path>
  69. Execute · Benchmark & validation setup

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

    1 call · #0083–#0083

    python3 - <script>
  70. Profile · Source & workspace

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

    2 calls · #0084–#0085

    tail -n <n> <path> <n> > <path>cat <path>tail -n <n> <path>rg --files <path> <n> > <path>head -n <n>
  71. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0086–#0086

    Apply patch <patch>
  72. Inspect · Attention kernels

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

    1 call · #0087–#0087

    git diff --checkgit diff --statpython3 -m <module> <script>
  73. Profile · Source & workspace

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

    1 call · #0088–#0088

    tail -n <n> <path>rg --files <path> <n> > <path>head -n <n>
  74. Inspect · Source & workspace

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

    1 call · #0089–#0089

    rg --files <path>rg <val>head -n <n>tail -n <n> <path>
  75. Profile · Benchmark & validation setup

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

    1 call · #0090–#0090

    python3 - <script>
  76. Profile · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0091–#0091

    python3 - <script>
  77. Inspect · Attention kernels

    Requested script or workload execution related to attention kernels.

    1 call · #0092–#0092

    python3 - <script>
  78. Profile · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0093–#0093

    python3 - <script>
  79. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0094–#0094

    tail -n <n> <path>
  80. Inspect · Parallelism & communication

    1 tool error

    Requested file and log inspection and source searches related to parallelism & communication.

    1 call · #0095–#0095

    sed -n <val> <path>rg -n <val> <path> <path> <path>
  81. Profile · Source & workspace

    1 tool error

    Requested script or workload execution related to source & workspace.

    2 calls · #0096–#0097

    python3 - <script>
  82. Inspect · Attention kernels

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

    1 call · #0098–#0098

    tail -n <n> <path>ps <flag> <args>rg <val>cut <flag>head -n <n>
  83. Validate · Attention kernels

    Requested environment setup or inspection related to attention kernels.

    1 call · #0099–#0099

    env <vars> python3 -m <module> <script> <script> -q > <path> <n> >& <path>
  84. Profile · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0100–#0100

    python3 - <script>
  85. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0101–#0101

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

    Requested repository inspection and runtime inspection related to device memory.

    1 call · #0102–#0102

    git diff --checknpu-smi info -t <val>
  87. Profile · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0103–#0103

    python3 - <script>
  88. Inspect · Benchmark & validation setup

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

    1 call · #0104–#0104

    rg -n <val> <path> <path> <path> -g <path>head -n <n>tail -n <n> <path>
  89. Profile · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0105–#0105

    python3 - <script>
  90. Inspect · Attention kernels

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

    2 calls · #0106–#0107

    rg -n <val> <val> <path> -g <path>sed -n <val> <path>rg -n <val> <path> -g <path>tail -n <n> <path>git diff <flag> <args>
  91. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0108–#0108

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

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

    1 call · #0109–#0109

    rg -n <val> <path> -g <path>cat <path>
  93. Inspect · Checkpoints & weight state

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

    1 call · #0110–#0110

    rg <val> <path>tail -n <n>du <flag> <args>tail -n <n> <path>
  94. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0111–#0111

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

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

    1 call · #0112–#0112

    du <flag> <args>tail -n <n> <path>
  96. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0113–#0113

    Apply patch <patch>
  97. Inspect · Attention kernels

    Requested repository inspection and file and log inspection related to attention kernels.

    1 call · #0114–#0114

    git diff --checkgit -C <path> <val> --checksed -n <val> <path>
  98. Validate · Attention kernels

    1 tool error

    Requested script or workload execution related to attention kernels.

    1 call · #0115–#0115

    bash <script> > <path> <n> > <path>
  99. Other · Attention kernels

    Requested script or workload execution related to attention kernels.

    1 call · #0116–#0116

    bash <script> > <path>
  100. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0117–#0117

    Apply patch <patch>
  101. Other · Attention kernels

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

    1 call · #0118–#0118

    git -C <path> <val> <flag> <args>python3 -m <module> <script>
  102. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0119–#0119

    cat <path>
  103. Validate · Attention kernels

    Requested script or workload execution related to attention kernels.

    1 call · #0120–#0120

    python3 - <script>
  104. Inspect · Attention kernels

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

    3 calls · #0121–#0123

    python3 - <script>tail -n <n> <path>cat <path>rg -n <val> <path>head -n <n>sed -n <val> <path>
  105. Inspect · Optimizer & gradients

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

    1 call · #0124–#0124

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

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

    1 call · #0125–#0125

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

    Requested file and log inspection related to attention kernels.

    1 call · #0126–#0126

    tail -n <n> <path>cat <path>
  108. Inspect · Parallelism & communication

    Requested source searches and file and log inspection related to parallelism & communication.

    1 call · #0127–#0127

    rg -n <val> <path>head -n <n>sed -n <val> <path>
  109. Inspect · Checkpoints & weight state

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

    1 call · #0128–#0128

    tail -n <n> <path>du <flag> <args>
  110. Inspect · Parallelism & communication

    Requested file and log inspection related to parallelism & communication.

    1 call · #0129–#0129

    sed -n <val> <path>cat <path>head -n <n>
  111. Inspect · Checkpoints & weight state

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

    1 call · #0130–#0130

    tail -n <n> <path>du <flag> <args>ps <flag> <args>rg <path>cut <flag>head -n <n>
  112. Inspect · Parallelism & communication

    Requested source searches and file and log inspection related to parallelism & communication.

    1 call · #0131–#0131

    rg -n <val> <path>tail -n <n>sed -n <val> <path>cat <path>
  113. Validate · Checkpoints & weight state

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

    1 call · #0132–#0132

    tail -n <n> <path>du <flag> <args>git diff --statgit -C <path> <val> --stat
  114. Inspect · Source & workspace

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

    1 call · #0133–#0133

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

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

    1 call · #0134–#0134

    tail -n <n> <path>du <flag> <args>tail -n <n> <path> <n> > <path>
  116. Inspect · Source & workspace

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

    1 call · #0135–#0135

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

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

    1 call · #0136–#0136

    tail -n <n> <path>du <flag> <args>
  118. Inspect · Source & workspace

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

    1 call · #0137–#0137

    rg -n <val> <path> <path> -g <path>sed -n <val> <path>
  119. Inspect · Checkpoints & weight state

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

    1 call · #0138–#0138

    tail -n <n> <path>du <flag> <args>
  120. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0139–#0139

    tail -n <n> <path>
  121. Validate · Attention kernels

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

    3 calls · #0140–#0142

    tail -n <n> <path>tail -n <n> <path> <n> > <path>bash <script> > <path> <n> > <path>cat <path> <n> > <path>git diff --checkgit -C <path> <val> --check
  122. Inspect · Parallelism & communication

    Requested file and log inspection related to parallelism & communication.

    1 call · #0143–#0143

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

    Requested file and log inspection related to attention kernels.

    1 call · #0144–#0144

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

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

    1 call · #0145–#0145

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

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

    1 call · #0146–#0146

    python3 - <script>
  126. Inspect · Source & workspace

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

    2 calls · #0147–#0148

    ls -l -t <val>head -n <n>git diff --stat
  127. Inspect · Benchmark & validation setup

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

    1 call · #0149–#0149

    ps <flag> <args>rg <val>
  128. Inspect · Source & workspace

    Requested repository inspection related to source & workspace.

    1 call · #0150–#0150

    git diff --stat
  129. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0151–#0151

    cat <path>tail -n <n> <path>
  130. Inspect · Task requirements

    Requested file and log inspection related to task requirements.

    1 call · #0152–#0152

    cat <path> <path>
  131. Inspect · Attention kernels

    Requested repository inspection related to attention kernels.

    1 call · #0153–#0153

    git diff <flag> <args>
  132. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0154–#0154

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

    Requested repository inspection and source searches related to attention kernels.

    1 call · #0155–#0155

    git diff <flag> <args>rg -n <val> <path> <path>
  134. Profile · Attention kernels

    Requested script or workload execution related to attention kernels.

    1 call · #0156–#0156

    python3 - <script>
  135. Inspect · Benchmark & validation setup

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

    1 call · #0157–#0157

    cat <path>
  136. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    3 calls · #0158–#0160

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

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

    1 call · #0161–#0161

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

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

    1 call · #0162–#0162

    cat <path>
  139. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0163–#0163

    sed -n <val> <path>
  140. Inspect · Parallelism & communication

    Requested source searches and file and log inspection related to parallelism & communication.

    1 call · #0164–#0164

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

    Requested file and log inspection related to source & workspace.

    2 calls · #0165–#0166

    sed -n <val> <path>cat <path>
  142. Profile · Parallelism & communication

    Requested script or workload execution related to parallelism & communication.

    1 call · #0167–#0167

    python3 - <script>
  143. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0168–#0168

    Apply patch <patch>
  144. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0169–#0169

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

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

    2 calls · #0170–#0171

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

    Requested repository inspection related to source & workspace.

    1 call · #0172–#0172

    git diff --check
  147. Inspect · Benchmark & validation setup

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

    1 call · #0173–#0173

    rg -n <val> <path> <path>head -n <n>
  148. Other · Parallelism & communication

    Requested script or workload execution related to parallelism & communication.

    1 call · #0174–#0174

    python3 - <script>
  149. Inspect · Parallelism & communication

    Requested file and log inspection related to parallelism & communication.

    1 call · #0175–#0175

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

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

    2 calls · #0176–#0177

    cat <path>rg --files <val>rg <val>head -n <n>
  151. Inspect · Optimizer & gradients

    Requested file and log inspection related to optimizer & gradients.

    1 call · #0178–#0178

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

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

    2 calls · #0179–#0180

    cat <path>rg --files <val>rg <val>
  153. Inspect · Benchmark & validation setup

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

    1 call · #0181–#0181

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

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

    1 call · #0182–#0182

    rg -n <val> <path> <path> <path> -g <path>head -n <n>
  155. Inspect · Parallelism & communication

    Requested file and log inspection related to parallelism & communication.

    1 call · #0183–#0183

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

    Requested file and log inspection related to source & workspace.

    2 calls · #0184–#0185

    sed -n <val> <path>
  157. Inspect · Parallelism & communication

    Requested file and log inspection related to parallelism & communication.

    1 call · #0186–#0186

    cat <path>
  158. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0187–#0188

    sed -n <val> <path>
  159. Other · Benchmark & validation setup

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

    1 call · #0189–#0189

    python3 - <script>
  160. Inspect · Optimizer & gradients

    Requested source searches related to optimizer & gradients.

    1 call · #0190–#0190

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

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

    1 call · #0191–#0191

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

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

    2 calls · #0192–#0193

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

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

    1 call · #0194–#0194

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

    Requested source searches related to source & workspace.

    1 call · #0195–#0195

    rg -n <val> <path>
  165. Other · Source & workspace

    1 tool error

    Requested tool activity related to source & workspace.

    1 call · #0196–#0196

    command -v <val> <val> <val>
  166. Inspect · Runtime processes

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

    1 call · #0197–#0197

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

    Requested file and log inspection related to source & workspace.

    5 calls · #0198–#0202

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

    Requested file and log inspection related to attention kernels.

    1 call · #0203–#0203

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

    Requested tool activity related to checkpoints & weight state.

    1 call · #0204–#0204

    du <flag> <args>
  170. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0205–#0205

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

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

    1 call · #0206–#0206

    ps <flag> <args>rg <path>
  172. Inspect · Checkpoints & weight state

    1 tool error

    Requested source searches related to checkpoints & weight state.

    2 calls · #0207–#0208

    rg -n <val> <path> <path> <path>rg -n <val> <path> <path>
  173. Other · Runtime processes

    Requested script or workload execution related to runtime processes.

    1 call · #0209–#0209

    python3 - <script>
  174. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0210–#0210

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

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

    1 call · #0211–#0211

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

    Requested file and log inspection related to optimizer & gradients.

    2 calls · #0212–#0213

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

    1 tool error

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

    6 calls · #0214–#0219

    sed -n <val> <path>head -n <n> <path>git status --shortls -l <path> <path>
  178. Inspect · Benchmark & validation setup

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

    1 call · #0220–#0220

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

    Requested repository inspection related to source & workspace.

    1 call · #0221–#0221

    git status --short
  180. Inspect · Optimizer & gradients

    Requested file and log inspection related to optimizer & gradients.

    1 call · #0222–#0222

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

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

    1 call · #0223–#0223

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

    1 tool error

    Requested workspace inspection related to source & workspace.

    1 call · #0224–#0224

    ls -l <path>
  183. Profile · Optimizer & gradients

    Requested script or workload execution related to optimizer & gradients.

    1 call · #0225–#0225

    python3 - <script>
  184. Validate · Checkpoints & weight state

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

    1 call · #0226–#0226

    python3 - <script>
  185. Inspect · Benchmark & validation setup

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

    1 call · #0227–#0227

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

    Requested file and log inspection related to source & workspace.

    3 calls · #0228–#0230

    cat <path>tail -n <n> <path>
  187. Inspect · Attention kernels

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

    2 calls · #0231–#0232

    cat <path>rg --files <val>rg <val>
  188. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0233–#0233

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

    Requested file and log inspection related to attention kernels.

    1 call · #0234–#0234

    cat <path>
  190. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0235–#0235

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

    1 tool error

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

    5 calls · #0236–#0240

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

    Requested file and log inspection related to source & workspace.

    1 call · #0241–#0241

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

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

    1 call · #0242–#0242

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

    1 tool error

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

    2 calls · #0243–#0244

    cat <path>tail -n <n> <path>
  195. Validate · Optimizer & gradients

    Requested script or workload execution related to optimizer & gradients.

    1 call · #0245–#0245

    python3 - <script>
  196. Other · Runtime processes

    Requested script or workload execution related to runtime processes.

    1 call · #0246–#0246

    python3 - <script>
  197. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0247–#0247

    tail -n <n> <path>
  198. Execute · Benchmark & validation setup

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

    1 call · #0248–#0248

    python3 - <script>
  199. Other · Parallelism & communication

    Requested script or workload execution related to parallelism & communication.

    1 call · #0249–#0249

    python3 - <script>
  200. Profile · Benchmark & validation setup

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

    1 call · #0250–#0250

    python3 - <script>
  201. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0251–#0252

    cat <path>tail -n <n> <path>
  202. Edit · Parallelism & communication

    Requested code edits related to parallelism & communication.

    1 call · #0253–#0253

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

    Requested repository inspection related to source & workspace.

    2 calls · #0254–#0255

    git diff --check
  204. Other · Attention kernels

    Requested script or workload execution related to attention kernels.

    2 calls · #0256–#0257

    python3 -m <module> <script> <script> <script>
  205. Other · Parallelism & communication

    Requested script or workload execution related to parallelism & communication.

    1 call · #0258–#0258

    python3 - <script>
  206. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0259–#0260

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

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

    1 call · #0261–#0261

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

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

    8 calls · #0262–#0269

    tail -n <n> <path>git diff --statrg -n <val> <path> -g <path>head -n <n>rg -n <flag> <args>sed -n <val> <path>
    1 more command sketches
    git diff <flag> <args>
  209. Inspect · Benchmark & validation setup

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

    3 calls · #0270–#0272

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

    Requested script or workload execution related to optimizer & gradients.

    1 call · #0273–#0273

    python3 - <script>
  211. Inspect · Benchmark & validation setup

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

    1 call · #0274–#0274

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

    Requested tool activity related to checkpoints & weight state.

    1 call · #0275–#0275

    du <flag> <args>
  213. Inspect · Runtime processes

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

    1 call · #0276–#0276

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

    1 tool error

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

    2 calls · #0277–#0278

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

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

    1 call · #0279–#0279

    tail -n <n> <path>
  216. Other · Optimizer & gradients

    Requested script or workload execution related to optimizer & gradients.

    1 call · #0280–#0280

    python3 - <script>
  217. Inspect · Benchmark & validation setup

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

    1 call · #0281–#0281

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

    1 tool error

    Requested file and log inspection related to source & workspace.

    1 call · #0282–#0282

    cat <path>
  219. Validate · Checkpoints & weight state

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

    1 call · #0283–#0283

    python3 - <script>
  220. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0284–#0284

    cat <path>
  221. Edit · Parallelism & communication

    Requested code edits related to parallelism & communication.

    1 call · #0285–#0285

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

    Requested file and log inspection related to source & workspace.

    1 call · #0286–#0286

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

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

    1 call · #0287–#0287

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

    Requested repository inspection related to source & workspace.

    1 call · #0288–#0288

    git diff --check
  225. Inspect · Benchmark & validation setup

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

    2 calls · #0289–#0290

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

    Requested repository inspection related to source & workspace.

    1 call · #0291–#0291

    git diff --stat
  227. Inspect · Benchmark & validation setup

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

    1 call · #0292–#0292

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

    Requested repository inspection related to source & workspace.

    1 call · #0293–#0293

    git diff --stat
  229. Inspect · Benchmark & validation setup

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

    4 calls · #0294–#0297

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

    1 tool error

    Requested file and log inspection related to source & workspace.

    1 call · #0298–#0298

    cat <path>
  231. Validate · Checkpoints & weight state

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

    1 call · #0299–#0299

    python3 - <script>
  232. Inspect · Benchmark & validation setup

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

    1 call · #0300–#0300

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

    Requested file and log inspection related to source & workspace.

    1 call · #0301–#0301

    cat <path>
  234. Validate · Checkpoints & weight state

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

    1 call · #0302–#0302

    python3 - <script>
  235. Inspect · Checkpoints & weight state

    1 tool error

    Requested source searches related to checkpoints & weight state.

    1 call · #0303–#0303

    rg --files <path>
  236. Inspect · Source & workspace

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

    1 call · #0304–#0304

    rg -n <val> <path>tail -n <n>
  237. Edit · Optimizer & gradients

    Requested code edits related to optimizer & gradients.

    2 calls · #0305–#0306

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

    Requested repository inspection related to source & workspace.

    1 call · #0307–#0307

    git diff --check
  239. Inspect · Optimizer & gradients

    1 tool error

    Requested source searches related to optimizer & gradients.

    1 call · #0308–#0308

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

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

    2 calls · #0309–#0310

    tail -n <n> <path>git diff --check
  241. Inspect · Optimizer & gradients

    Requested source searches and repository inspection related to optimizer & gradients.

    2 calls · #0311–#0312

    rg -n <val> <path>git diff <flag> <args>
  242. Inspect · Dependencies & build setup

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

    1 call · #0313–#0313

    sed -n <val> <path>
  243. Other · Optimizer & gradients

    Requested script or workload execution related to optimizer & gradients.

    1 call · #0314–#0314

    python3 -m <module> <script>
  244. Inspect · Benchmark & validation setup

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

    2 calls · #0315–#0316

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

    Requested repository inspection related to source & workspace.

    1 call · #0317–#0317

    git status --short
  246. Inspect · Benchmark & validation setup

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

    1 call · #0318–#0318

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

    Requested repository inspection related to source & workspace.

    1 call · #0319–#0319

    git status --short
  248. Inspect · Benchmark & validation setup

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

    2 calls · #0320–#0321

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

    1 tool error

    Requested file and log inspection related to source & workspace.

    1 call · #0322–#0322

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

    1 tool error

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

    2 calls · #0323–#0324

    ls -l <path> <path>tail -n <n> <path>
  251. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0325–#0325

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

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

    5 calls · #0326–#0330

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

    Requested repository inspection related to source & workspace.

    2 calls · #0331–#0332

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

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

    2 calls · #0333–#0334

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

    1 tool error

    Requested file and log inspection related to source & workspace.

    1 call · #0335–#0335

    cat <path>
  256. Validate · Checkpoints & weight state

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

    1 call · #0336–#0336

    python3 - <script>
  257. Execute · Benchmark & validation setup

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

    1 call · #0337–#0337

    python3 - <script>
  258. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0338–#0338

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

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

    1 call · #0339–#0339

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

    Requested repository inspection related to attention kernels.

    2 calls · #0340–#0341

    git diff <flag> <args>
  261. Validate · Benchmark & validation setup

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

    1 call · #0342–#0342

    python3 - <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.

mindspeed · 4 changed files

Base commit: df2ea7fad8e43016b0e2edbf7ce16026496df2ae

diff --git a/mindspeed/core/fusions/fused_rope.py b/mindspeed/core/fusions/fused_rope.pyindex 00a3d66e41411ac63b1e52536194bc47fa38d397..9a3e16f910adec118dae40d07a201ef3a564016a 100644--- a/mindspeed/core/fusions/fused_rope.py+++ b/mindspeed/core/fusions/fused_rope.py@@ -24,6 +24,36 @@ except ImportError:     HAVE_APPLY_ROPE_FUSION = False  +def _rotary_cos_sin(freqs: Tensor, dtype: torch.dtype, mscale: float):+    """Reuse constant RoPE factors for the lifetime of a frequency tensor.++    Keep just one entry on the tensor, rather than retaining frequency tensors in+    a global cache. Learned frequencies must build a fresh autograd graph, and+    inference tensors must not be reused by a subsequent training forward.+    """+    cacheable = (+        not freqs.requires_grad+        and not torch.is_inference_mode_enabled()+        and not torch.is_inference(freqs)+        and isinstance(mscale, (float, int))+    )+    if cacheable:+        # A different stream must compute its own factors: readiness of freqs+        # alone does not imply readiness of factors produced on another stream.+        stream = None+        if freqs.device.type in ("cuda", "npu"):+            stream = getattr(torch, freqs.device.type).current_stream(freqs.device)+        key = (freqs._version, dtype, mscale, stream)+        cached = getattr(freqs, "_mindspeed_rotary_cos_sin", None)+        if cached is not None and cached[0] == key:+            return cached[1], cached[2]++    cos = (torch.cos(freqs) * mscale).to(dtype)+    sin = (torch.sin(freqs) * mscale).to(dtype)+    if cacheable:+        freqs._mindspeed_rotary_cos_sin = (key, cos, sin)+    return cos, sin+  def apply_rotary_pos_emb_bshd(     t: Tensor,@@ -61,9 +91,12 @@ def apply_rotary_pos_emb_bshd(         t = torch.cat((x1, x2), dim=-1)      rot_dim = freqs.shape[-1]-    t, t_pass = t[..., :rot_dim], t[..., rot_dim:]-    cos_ = (torch.cos(freqs) * _mscale).to(t.dtype)-    sin_ = (torch.sin(freqs) * _mscale).to(t.dtype)+    # Full-width RoPE needs neither a split nor a concatenation. Apart from the+    # forward copy, the full-width slice would also add a slice backward copy.+    t_pass = None+    if rot_dim < t.shape[-1]:+        t, t_pass = t[..., :rot_dim], t[..., rot_dim:]+    cos_, sin_ = _rotary_cos_sin(freqs, t.dtype, _mscale)      if getattr(args, "use_fused_rotary_pos_emb"):         mode = 1 if rotary_interleaved else 0@@ -71,7 +104,7 @@ def apply_rotary_pos_emb_bshd(     else:         t = (t * cos_) + (_rotate_half(t, rotary_interleaved) * sin_) -    return torch.cat((t, t_pass), dim=-1)+    return torch.cat((t, t_pass), dim=-1) if t_pass is not None else t   def transformer_config_post_init_wrapper(fn):diff --git a/mindspeed/core/optimizer/adamw.py b/mindspeed/core/optimizer/adamw.pyindex 703fae190431f281ddca75e56de8df6feabdbf6b..a47e65c854dc607029cb1b8a2bba9c40a3207725 100644--- a/mindspeed/core/optimizer/adamw.py+++ b/mindspeed/core/optimizer/adamw.py@@ -23,19 +23,23 @@ def adamw(params: List[Tensor],     r"""Functional API that performs AdamW algorithm computation.     See :class:`~torch.optim.AdamW` for details.     """-    for i, param in enumerate(params):-        grad = grads[i]-        exp_avg = exp_avgs[i]-        exp_avg_sq = exp_avg_sqs[i]-        max_exp_avg_sq = max_exp_avg_sqs[i] if amsgrad else None+    if not params:+        return++    # The fused operator accepts tensor lists. Batch compatible tensors instead+    # of paying Python and dispatcher overhead for every parameter separately.+    grouped_tensors = Optimizer._group_tensors_by_device_and_dtype(+        [params, grads, exp_avgs, exp_avg_sqs, max_exp_avg_sqs if amsgrad else []])+    for tensors, _ in grouped_tensors.values():+        group_params, group_grads, group_exp_avgs, group_exp_avg_sqs, group_max_exp_avg_sqs = tensors          torch._fused_adamw_(-            [param],-            [grad],-            [exp_avg],-            [exp_avg_sq],-            [max_exp_avg_sq] if amsgrad else [],-            [step_tensor],+            group_params,+            group_grads,+            group_exp_avgs,+            group_exp_avg_sqs,+            group_max_exp_avg_sqs,+            [step_tensor] * len(group_params),             amsgrad=amsgrad,             lr=lr,             beta1=beta1,diff --git a/mindspeed/core/tensor_parallel/cross_entropy.py b/mindspeed/core/tensor_parallel/cross_entropy.pyindex 576c1536bffd8a1e73a3d07480a2dab8831274cf..f958df37915fcab34772318ab92c7cdb162fb526 100644--- a/mindspeed/core/tensor_parallel/cross_entropy.py+++ b/mindspeed/core/tensor_parallel/cross_entropy.py@@ -1,6 +1,46 @@+from functools import wraps from typing import Tuple  import torch+import torch_npu+++def vocab_parallel_cross_entropy_wrapper(fn):+    """Fuse the FP32 loss calculation for unsharded low-precision NPU logits."""+    from megatron.core.parallel_state import get_tensor_model_parallel_world_size++    @wraps(fn)+    def wrapper(vocab_parallel_logits, target, label_smoothing=0.0):+        # The distributed and label-smoothed cases retain Megatron's reduction+        # and smoothing conventions. The native kernel accepts at most 200000+        # rows and requires int64 class indices on the same device as logits.+        if (+            vocab_parallel_logits.device.type == 'npu'+            and vocab_parallel_logits.dtype in (torch.float16, torch.bfloat16)+            and target.device == vocab_parallel_logits.device+            and target.dtype == torch.int64+            and vocab_parallel_logits.shape[:-1] == target.shape+            and 0 < target.numel() <= 200000+            and vocab_parallel_logits.shape[-1] > 0+            and label_smoothing == 0.0+            and get_tensor_model_parallel_world_size() == 1+            and hasattr(torch_npu, 'npu_cross_entropy_loss')+        ):+            vocab_size = vocab_parallel_logits.shape[-1]+            # Megatron also handles targets outside the vocabulary (including+            # fine-tuning ignore markers). Preserve that behavior instead of+            # passing invalid indices to the native kernel.+            if not ((target >= 0) & (target < vocab_size)).all().item():+                return fn(vocab_parallel_logits, target, label_smoothing)+            # Match Megatron's FP32 softmax/loss arithmetic and unreduced output.+            # Autograd casts the input gradient back to the original dtype.+            logits = vocab_parallel_logits.float().reshape(-1, vocab_size)+            loss, _, _, _ = torch_npu.npu_cross_entropy_loss(+                logits, target.reshape(-1), reduction='none')+            return loss.view_as(target)+        return fn(vocab_parallel_logits, target, label_smoothing)++    return wrapper   def calculate_predicted_logits(diff --git a/mindspeed/features_manager/affinity/affinity.py b/mindspeed/features_manager/affinity/affinity.pyindex 99cbdb20053f0fa6c3824fc16630e3c8c77508c0..82856e9b4191d087c0da304a4d9e73d1b0afad07 100644--- a/mindspeed/features_manager/affinity/affinity.py+++ b/mindspeed/features_manager/affinity/affinity.py@@ -11,8 +11,12 @@ class AffinityFeature(MindSpeedFeature):         return self.optimization_level <= args.optimization_level      def register_patches(self, patch_manager, args):-        from mindspeed.core.tensor_parallel.cross_entropy import calculate_predicted_logits+        from mindspeed.core.tensor_parallel.cross_entropy import (+            calculate_predicted_logits, vocab_parallel_cross_entropy_wrapper)         # use logical negation followed by multiplication to achieve the same effect as setting selected elements to zero         patch_manager.register_patch(             'megatron.core.tensor_parallel.cross_entropy.VocabParallelCrossEntropy.calculate_predicted_logits',             calculate_predicted_logits)+        patch_manager.register_patch(+            'megatron.core.tensor_parallel.cross_entropy.vocab_parallel_cross_entropy',+            vocab_parallel_cross_entropy_wrapper)
mindspeed_llm · 3 changed files

Base commit: 72c49a6260c73669678b8f39b1ba41a4789bb555

diff --git a/mindspeed_llm/core/models/common/embeddings/rotary_pos_embedding.py b/mindspeed_llm/core/models/common/embeddings/rotary_pos_embedding.pyindex bd2b975cb13f4d801c4b7668fb4c4e0e22d3b015..b4ddd1e8c19879be4293a7136a72c3def12afcb3 100644--- a/mindspeed_llm/core/models/common/embeddings/rotary_pos_embedding.py+++ b/mindspeed_llm/core/models/common/embeddings/rotary_pos_embedding.py@@ -12,6 +12,7 @@ from megatron.training import get_args from megatron.core import parallel_state from megatron.core.models.common.embeddings.rotary_pos_embedding import _rotate_half, get_pos_emb_on_this_cp_rank from mindspeed.ops.npu_rotary_position_embedding import npu_rotary_position_embedding+from mindspeed.core.fusions.fused_rope import _rotary_cos_sin from mindspeed_llm.tasks.common.yarn_rope import YarnRotaryPositionEmbedding  @@ -249,14 +250,15 @@ def apply_rotary_pos_emb_bshd(                 1 + math.log(scale) / math.log(args.rope_scaling_original_max_position_embeddings))      rot_dim = freqs.shape[-1]-    t, t_pass = t[..., :rot_dim], t[..., rot_dim:]+    t_pass = None+    if rot_dim < t.shape[-1]:+        t, t_pass = t[..., :rot_dim], t[..., rot_dim:]      if multi_latent_attention:         *dims, d = t.shape         t = t.reshape(*dims, d // 2, 2).transpose(-2, -1).reshape(*dims, d) -    cos_ = (torch.cos(freqs) * _mscale).to(t.dtype)-    sin_ = (torch.sin(freqs) * _mscale).to(t.dtype)+    cos_, sin_ = _rotary_cos_sin(freqs, t.dtype, _mscale)          if args.use_fused_rotary_pos_emb:         mode = 1 if rotary_interleaved else 0@@ -264,7 +266,7 @@ def apply_rotary_pos_emb_bshd(     else:         t = (t * cos_) + (_rotate_half(t, rotary_interleaved) * sin_)     -    return torch.cat((t, t_pass), dim=-1)+    return torch.cat((t, t_pass), dim=-1) if t_pass is not None else t   def apply_rotary_pos_emb_thd(@@ -315,4 +317,4 @@ def apply_rotary_pos_emb_bshd_in_complex(     if rotary_interleaved:         y = torch.cat([y[..., 0::2], y[..., 1::2]], dim=-1)     -    return y.to(t.dtype)\ No newline at end of file+    return y.to(t.dtype)diff --git a/mindspeed_llm/features_manager/affinity/affinity.py b/mindspeed_llm/features_manager/affinity/affinity.pyindex 339f55d1d6ea8b4aa617444b60c21b2e90b442c8..cd74464dc45326d70c1b4d38add21119db2e9e56 100644--- a/mindspeed_llm/features_manager/affinity/affinity.py+++ b/mindspeed_llm/features_manager/affinity/affinity.py@@ -6,8 +6,13 @@ class AffinityFeature(MindSpeedFeature):     def __init__(self):         super(AffinityFeature, self).__init__('affinity', optimization_level=0) -    def register_patches(self, patch_manager, args):-        from mindspeed_llm.core.tensor_parallel.cross_entropy import calculate_predicted_logits+    def register_patches(self, patch_manager, args):+        from mindspeed_llm.core.tensor_parallel.cross_entropy import calculate_predicted_logits+        from mindspeed.core.tensor_parallel.cross_entropy import vocab_parallel_cross_entropy_wrapper         # use logical negation followed by multiplication to achieve the same effect as setting selected elements to zero-        patch_manager.register_patch('megatron.core.tensor_parallel.cross_entropy.VocabParallelCrossEntropy.calculate_predicted_logits',-                                      calculate_predicted_logits)\ No newline at end of file+        patch_manager.register_patch('megatron.core.tensor_parallel.cross_entropy.VocabParallelCrossEntropy.calculate_predicted_logits',+                                      calculate_predicted_logits)+        if args.optimization_level >= 1:+            patch_manager.register_patch(+                'megatron.core.tensor_parallel.cross_entropy.vocab_parallel_cross_entropy',+                vocab_parallel_cross_entropy_wrapper)diff --git a/mindspeed_llm/training/arguments.py b/mindspeed_llm/training/arguments.pyindex 5acc7055839ec0a40f89903ef9a06165c5aa4091..174b964c8781647bed34f5122256678917c89266 100644--- a/mindspeed_llm/training/arguments.py+++ b/mindspeed_llm/training/arguments.py@@ -50,9 +50,46 @@ def process_args_v2(parser):      MindSpeedFeaturesManager.register_features_args(parser) +    group = parser.add_argument_group(title='data-parallel communication defaults')+    group.add_argument('--no-overlap-grad-reduce', action='store_false',+                       dest='overlap_grad_reduce',+                       help='Disable gradient communication overlap. Enabled by default for '+                            'dense MCore distributed-optimizer training with only data parallelism '+                            'at optimization level 1 or higher.')+    group.add_argument('--no-overlap-param-gather', action='store_false',+                       dest='overlap_param_gather',+                       help='Disable parameter communication overlap. Enabled by default together '+                            'with gradient communication overlap for supported data-parallel training.')+    # Preserve the distinction between an omitted option and an explicit opt-out.+    parser.set_defaults(overlap_grad_reduce=None, overlap_param_gather=None)+     return parser  +def _set_data_parallel_overlap_defaults(args, defaults):+    """Use the existing bucket scheduling for ordinary dense data parallelism."""+    enabled = (+        getattr(args, 'optimization_level', 0) >= 1+        and getattr(args, 'ai_framework', 'pytorch') == 'pytorch'+        and getattr(args, 'use_distributed_optimizer', False)+        and getattr(args, 'world_size', 1) > 1+        and all(getattr(args, name, 1) == 1 for name in (+            'tensor_model_parallel_size', 'pipeline_model_parallel_size',+            'context_parallel_size', 'expert_model_parallel_size',+            'num_distributed_optimizer_instances'))+        and not any(getattr(args, name, False) for name in (+            'use_legacy_models', 'num_experts', 'encoder_pipeline_model_parallel_size',+            'use_custom_fsdp', 'use_torch_fsdp2', 'optimizer_cpu_offload',+            'swap_optimizer', 'enable_high_availability', 'use_cpu_initialization',+            'enable_cuda_graph', 'lazy_mpu_init', 'skip_train'))+    )+    if args.overlap_grad_reduce is None:+        args.overlap_grad_reduce = defaults.get('overlap_grad_reduce', enabled)+    if args.overlap_param_gather is None:+        args.overlap_param_gather = defaults.get(+            'overlap_param_gather', enabled and args.overlap_grad_reduce)++ def get_layer_offset(pp_size, num_layer_list):     """     Get layer number offset for pp stage. global_layer_number = local_layer_number + layer_number_offset@@ -120,7 +157,9 @@ def validate_args_v2_decorator(megatron_validate_args):     def wrapper(args, defaults=None):         if defaults is None:             defaults = {}-                      ++        _set_data_parallel_overlap_defaults(args, defaults)+         # make prev validation and copy some args.         MindSpeedFeaturesManager.pre_validate_features_args(args)