GPT-6 Astra · Training

T03 · Packed DP2

Valid

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

1.06×PERFORMANCE RATIO
221TOOL 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 · 221 visible calls

InspectEditValidateExecuteBuildProfileRollbackOther
137Inspect
3Edit
43Validate
8Execute
19Profile
11Other

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 timeline157 groups · 221 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

    1 tool error

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

    3 calls · #0001–#0003

    pwdprintenv <vars>rg --files -g <val> -g <val> -g <val> <path> <path> <n> > <path>cat <path> <path><command> <args>cat <path>
    1 more command sketches
    rg --files --hidden -g <val> -g <path> <path> <path>
  2. Inspect · Source & workspace

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

    3 calls · #0004–#0006

    git status --shortgit log <flag> <args>ls -l -a <path>rg --files <path>head -n <n>
  3. Inspect · Benchmark & validation setup

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

    1 call · #0007–#0007

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

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

    1 call · #0008–#0008

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

    Requested file and log inspection related to source & workspace.

    1 call · #0009–#0009

    sed -n <val> <path>printf <val> <val> <val> <val>date -u
  6. Inspect · Benchmark & validation setup

    Requested source searches related to benchmark & validation setup.

    1 call · #0010–#0010

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

    Requested script or workload execution related to source & workspace.

    1 call · #0011–#0011

    bash <script>
  8. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0012–#0012

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

    1 tool error

    Requested source searches related to attention kernels.

    1 call · #0013–#0013

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

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

    1 call · #0014–#0014

    ls -l -h <val>tail -n <n> <path>
  11. Inspect · Attention kernels

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

    4 calls · #0015–#0018

    rg -n <val> <path> <path>rg --filesrg <val>head -n <n>rg -n <val> <path> <path> <path> <path>sed -n <val> <path>
    1 more command sketches
    cat <path>
  12. Inspect · Source & workspace

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

    1 call · #0019–#0019

    sed -n <val> <path>cat <val>ps <flag> <args>rg <val>
  13. Inspect · Attention kernels

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

    8 calls · #0020–#0027

    sed -n <val> <path>rg -n <val> <path>cat <path>rg --files <val>rg <val>rg -n <val> <val>
    2 more command sketches
    rg -n <val> <path> <path> <path>rg -n <val> <val> <path> <path>
  14. Inspect · Benchmark & validation setup

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

    1 call · #0028–#0028

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

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

    2 calls · #0029–#0030

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

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

    1 call · #0031–#0031

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

    1 tool error

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

    1 call · #0032–#0032

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

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

    1 call · #0033–#0033

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

    1 tool error

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

    7 calls · #0034–#0040

    cat <path>tail -n <n> <path>rg -n <val> <path>sed -n <val> <path>rg -n <val> <path> <path>
  20. Validate · Dependencies & build setup

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

    1 call · #0041–#0041

    date -utail -n <n> <path>ps <flag> <args>rg <val>tail -n <n>
  21. Inspect · Attention kernels

    1 tool error

    Requested file and log inspection related to attention kernels.

    1 call · #0042–#0042

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

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

    1 call · #0043–#0043

    ls -l -h <path>tail -n <n> <path>
  23. Inspect · Parallelism & communication

    Requested file and log inspection related to parallelism & communication.

    1 call · #0044–#0044

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

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

    1 call · #0045–#0045

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

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

    1 call · #0046–#0046

    rg -n <val> <path> --glob <path>head -n <n>sed -n <val> <path>
  26. Inspect · Optimizer & gradients

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

    1 call · #0047–#0047

    sed -n <val> <path>rg -n <val> <path> <path>head -n <n>
  27. Inspect · Parallelism & communication

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

    1 call · #0048–#0048

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

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

    1 call · #0049–#0049

    tail -n <n> <path>rg -n <val> <path> <path> <path> -g <path>head -n <n>
  29. Inspect · Dependencies & build setup

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

    1 call · #0050–#0050

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

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

    2 calls · #0051–#0052

    tail -n <n> <path>du <flag> <args>date -u<command> <args>
  31. Inspect · Source & workspace

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

    1 call · #0053–#0053

    free -hdf -h <path> <path>ps <flag> <args>sort <flag>head -n <n>
  32. Inspect · Parallelism & communication

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

    1 call · #0054–#0054

    rg -n <val> <path> <path> <path>tail -n <n>rg -n <val> <path> <path>head -n <n>
  33. Inspect · Optimizer & gradients

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

    1 call · #0055–#0055

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

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

    1 call · #0056–#0056

    rg -n <val> <path> --glob <val> --glob <val> --glob <val> --glob <val>head -n <n>tail -n <n> <path>du <flag> <args>
  35. Validate · Checkpoints & weight state

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

    1 call · #0057–#0057

    date -utail -n <n> <path>du <flag> <args><command> <args>
  36. Inspect · Source & workspace

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

    1 call · #0058–#0058

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

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

    1 call · #0059–#0059

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

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

    1 call · #0060–#0060

    tail -n <n> <path>ls -l -h <path> <n> > <path>date -u
  39. Inspect · Attention kernels

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

    1 call · #0061–#0061

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

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

    1 call · #0062–#0062

    cat <path> <path>ps -p <val> -o <val><command> <args>head -n <n>
  41. Validate · Checkpoints & weight state

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

    1 call · #0063–#0063

    tail -n <n> <path>du <flag> <args><command> <args>date -u
  42. Other · Optimizer & gradients

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

    1 call · #0064–#0064

    command -v <val>trueps -p <val> -o <val>cat <path> <path>rg -n <val> <path> <path> --glob <path>sed -n <val> <path>
  43. Validate · Checkpoints & weight state

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

    2 calls · #0065–#0066

    tail -n <n> <path><command> <args>du <flag> <args>date -u
  44. Inspect · Source & workspace

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

    1 call · #0067–#0067

    <command> <args>rg --files <path>head -n <n>
  45. Inspect · Attention kernels

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

    1 call · #0068–#0068

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

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

    2 calls · #0069–#0070

    tail -n <n> <path><command> <args>ls -l -h <path> <n> > <path>date -u
  47. Validate · Benchmark & validation setup

    Requested tool activity related to benchmark & validation setup.

    1 call · #0071–#0071

    <command> <args>date -u
  48. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0072–#0072

    python - <script>
  49. Validate · Benchmark & validation setup

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

    6 calls · #0073–#0078

    <command> <args>ls -l -h <path>date -utail -n <n> <path>ps <flag> <args>sort <flag>
    1 more command sketches
    head -n <n>
  50. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0079–#0079

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

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

    2 calls · #0080–#0081

    bash <script> > <path> <n> >& <path>tail -n <n> <path>date -u
  52. Inspect · Optimizer & gradients

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

    1 call · #0082–#0082

    rg -n <val> <path> <path> -g <path>head -n <n>sed -n <val> <path>
  53. Validate · Benchmark & validation setup

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

    1 call · #0083–#0083

    tail -n <n> <path>rg -n <val> <path>date -u
  54. Inspect · Optimizer & gradients

    Requested file and log inspection related to optimizer & gradients.

    1 call · #0084–#0084

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

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

    2 calls · #0085–#0086

    tail -n <n> <path>date -uls -l -h <path>
  56. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0087–#0087

    Apply patch <patch>
  57. Execute · Benchmark & validation setup

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

    1 call · #0088–#0088

    tail -n <n> <path><command> <args>date -u
  58. Inspect · Attention kernels

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

    1 call · #0089–#0089

    git diff --checkgit diff --statrg -n <val> <path>rg -n <val> <val>head -n <n>
  59. Validate · Benchmark & validation setup

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

    1 call · #0090–#0090

    python - <script>tail -n <n> <path>date -u
  60. Execute · Benchmark & validation setup

    Requested tool activity related to benchmark & validation setup.

    1 call · #0091–#0091

    <command> <args>date -u
  61. Other · Attention kernels

    Requested script or workload execution related to attention kernels.

    1 call · #0092–#0092

    python - <script>
  62. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0093–#0093

    Apply patch <patch>
  63. Execute · Benchmark & validation setup

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

    1 call · #0094–#0094

    tail -n <n> <path>date -u
  64. Validate · Checkpoints & weight state

    Requested workspace file updates and script or workload execution related to checkpoints & weight state.

    1 call · #0095–#0095

    mkdir -p <path>cp <path> <path> <path>python - <script>bash <script> > <path> <n> >& <path>
  65. Execute · Benchmark & validation setup

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

    1 call · #0096–#0096

    tail -n <n> <path>date -u
  66. Inspect · Source & workspace

    Requested repository inspection related to source & workspace.

    1 call · #0097–#0097

    git status --shortgit diff --check
  67. Execute · Attention kernels

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

    1 call · #0098–#0098

    python - <script>rg -n <val> <path>head -n <n>
  68. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0099–#0099

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

    Requested file and log inspection related to source & workspace.

    2 calls · #0100–#0101

    tail -n <n> <path>date -u
  70. Inspect · Runtime processes

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

    1 call · #0102–#0102

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

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

    1 call · #0103–#0103

    tail -n <n> <path>rg --files <path> <n> > <path>head -n <n>date -u
  72. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0104–#0104

    sed -n <val> <path>
  73. Profile · Benchmark & validation setup

    Requested workspace file updates and script or workload execution related to benchmark & validation setup.

    1 call · #0105–#0105

    cp <path> <path> <path>python - <script>
  74. Inspect · Source & workspace

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

    1 call · #0106–#0106

    ps <flag> <args>rg <val>date -u
  75. Profile · Source & workspace

    Requested script or workload execution and source searches related to source & workspace.

    2 calls · #0107–#0108

    python - <script>rg <path> <path>
  76. Edit · Attention kernels

    Requested code edits related to attention kernels.

    1 call · #0109–#0109

    Apply patch <patch>
  77. Inspect · Attention kernels

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

    3 calls · #0110–#0112

    git diff --checkgit diff --statsed -n <val> <path>tail -n <n> <path>date -ugit diff <flag> <args>
  78. Validate · Attention kernels

    Requested environment setup or inspection related to attention kernels.

    1 call · #0113–#0113

    env <vars> python -m <module> -q <script> > <path> <n> >& <path>
  79. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0114–#0114

    tail -n <n> <path>date -u
  80. Inspect · Source & workspace

    Requested repository inspection related to source & workspace.

    1 call · #0115–#0115

    git diff --check
  81. Validate · Benchmark & validation setup

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

    1 call · #0116–#0116

    tail -n <n> <path>date -u
  82. Profile · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0117–#0117

    python - <script>
  83. Profile · Attention kernels

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

    1 call · #0118–#0118

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

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

    2 calls · #0119–#0120

    tail -n <n> <path>date -u<command> <args>
  85. Inspect · Source & workspace

    Requested repository inspection related to source & workspace.

    1 call · #0121–#0121

    git status --short
  86. Validate · Benchmark & validation setup

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

    1 call · #0122–#0122

    tail -n <n> <path>date -u
  87. Inspect · Attention kernels

    Requested environment setup or inspection related to attention kernels.

    1 call · #0123–#0123

    env <vars> python -u - > <path> <n> >& <path> <script>
  88. Validate · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0124–#0124

    tail -n <n> <path>date -u
  89. Other · Checkpoints & weight state

    Requested tool activity related to checkpoints & weight state.

    1 call · #0125–#0125

    du <flag> <args>date -u
  90. Validate · Attention kernels

    Requested environment setup or inspection related to attention kernels.

    1 call · #0126–#0126

    env <vars> python -m <module> -q <script> > <path> <n> >& <path>
  91. Inspect · Checkpoints & weight state

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

    1 call · #0127–#0127

    tail -n <n> <path>du <flag> <args>date -u
  92. Other · Attention kernels

    Requested environment setup or inspection related to attention kernels.

    1 call · #0128–#0128

    env <vars> python -u - > <path> <n> >& <path> <script>
  93. Inspect · Checkpoints & weight state

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

    1 call · #0129–#0129

    tail -n <n> <path>du <flag> <args>date -u
  94. Profile · Source & workspace

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

    1 call · #0130–#0130

    python - <script>sed -n <val> <path>cat <path>
  95. Profile · Benchmark & validation setup

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

    1 call · #0131–#0131

    python - <script>tail -n <n> <path>date -u
  96. Validate · Checkpoints & weight state

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

    1 call · #0132–#0132

    tail -n <n> <path><command> <args>du <flag> <args>date -u
  97. Validate · Benchmark & validation setup

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

    1 call · #0133–#0133

    stat -c <val> <path>tail -n <n> <path>date -u
  98. Inspect · Source & workspace

    Requested repository inspection related to source & workspace.

    1 call · #0134–#0134

    git diff --numstatgit diff --check
  99. Validate · Benchmark & validation setup

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

    3 calls · #0135–#0137

    tail -n <n> <path>date -ubash <script> > <path> <n> >& <path>
  100. Validate · Checkpoints & weight state

    Requested workspace file updates and script or workload execution related to checkpoints & weight state.

    1 call · #0138–#0138

    mkdir -p <path>cp <path> <path> <path>python - <script>
  101. Validate · Benchmark & validation setup

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

    1 call · #0139–#0139

    tail -n <n> <path>stat -c <val> <path> <path> <path>date -u
  102. Profile · Attention kernels

    Requested script or workload execution related to attention kernels.

    1 call · #0140–#0140

    python -u - > <path> <n> >& <path> <script>
  103. Validate · Benchmark & validation setup

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

    1 call · #0141–#0141

    tail -n <n> <path>python - <script>git diff --stat
  104. Inspect · Benchmark & validation setup

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

    1 call · #0142–#0142

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

    Requested repository inspection related to source & workspace.

    1 call · #0143–#0143

    git diff --statgit status --short
  106. Inspect · Benchmark & validation setup

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

    1 call · #0144–#0144

    ps <flag> <args>rg <path>
  107. Inspect · Source & workspace

    Requested repository inspection related to source & workspace.

    1 call · #0145–#0145

    git diff --statgit status --short
  108. Inspect · Benchmark & validation setup

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

    1 call · #0146–#0146

    cat <path>
  109. Inspect · Task requirements

    Requested file and log inspection related to task requirements.

    1 call · #0147–#0147

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

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

    1 call · #0148–#0148

    git diffcat <path>
  111. Inspect · Source & workspace

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

    2 calls · #0149–#0150

    git diffrg -n <val> <path> <path> <path>
  112. Inspect · Precision & numerical checks

    Requested source searches related to precision & numerical checks.

    1 call · #0151–#0151

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

    Requested file and log inspection related to source & workspace.

    1 call · #0152–#0152

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

    1 tool error

    Requested source searches related to attention kernels.

    1 call · #0153–#0153

    rg --files <val>rg <val>
  115. Inspect · Benchmark & validation setup

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

    1 call · #0154–#0154

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

    Requested source searches related to attention kernels.

    1 call · #0155–#0155

    rg -n <val> <path>rg -n -A <n> <val> <path> <path>rg --files <val>rg <val>
  117. Inspect · Source & workspace

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

    2 calls · #0156–#0157

    sed -n <val> <path>rg -n <val> <path> <path> <path> <path>ps <flag> <args>rg <path>ls -l -t <val>head -n <n>
  118. Inspect · Dependencies & build setup

    Requested source searches related to dependencies & build setup.

    1 call · #0158–#0158

    rg -n -A <n> <val> <path>
  119. Inspect · Attention kernels

    1 tool error

    Requested file and log inspection related to attention kernels.

    2 calls · #0159–#0160

    sed -n <val> <path>
  120. Profile · Data movement

    Requested script or workload execution related to data movement.

    1 call · #0161–#0161

    python - <script>
  121. Inspect · Attention kernels

    1 tool error

    Requested file and log inspection related to attention kernels.

    2 calls · #0162–#0163

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

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

    1 call · #0164–#0164

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

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

    1 call · #0165–#0165

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

    1 tool error

    Requested source searches related to source & workspace.

    1 call · #0166–#0166

    rg -n <val> <path> <path> <path> <path>command -v <val>
  125. Inspect · Device memory

    1 tool error

    Requested source searches related to device memory.

    1 call · #0167–#0167

    rg -n <val> <path> <path> <path> <path>
  126. Inspect · Attention kernels

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

    1 call · #0168–#0168

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

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

    3 calls · #0169–#0171

    tail -n <n> <path>sed -n <val> <path>rg -n <val> <path>rg -n -A <n> <val> <path>rg -n <val> <path> <path>
  128. Profile · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0172–#0172

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

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

    1 call · #0173–#0173

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

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

    1 call · #0174–#0174

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

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

    1 call · #0175–#0175

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

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

    1 call · #0176–#0176

    tail -n <n> <path>ps <flag> <args>rg <val>
  133. Inspect · Source & workspace

    1 tool error

    Requested source searches related to source & workspace.

    2 calls · #0177–#0178

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

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

    2 calls · #0179–#0180

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

    1 tool error

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

    3 calls · #0181–#0183

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

    1 tool error

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

    2 calls · #0184–#0185

    tail -n <n> <path>test -s <path>python - <script>bash <script> > <path> <n> >& <path>
  137. Inspect · Source & workspace

    1 tool error

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

    2 calls · #0186–#0187

    sed -n <val> <path>rg -n <val> <path>head -n <n>tail -n <n> <path>rg -n <val> <val> <val> --glob <path>
  138. Validate · Benchmark & validation setup

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

    1 call · #0188–#0188

    python - <script>
  139. Profile · Source & workspace

    1 tool error

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

    1 call · #0189–#0189

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

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

    4 calls · #0190–#0193

    sed -n <val> <path>rg -n <val> <path>head -n <n>ps <flag> <args>rg <path>cut -c <val>
    3 more command sketches
    ls -l -t <val>tail -n <n> <path>rg -n <val> <path> --glob <path>
  141. Profile · Benchmark & validation setup

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

    1 call · #0194–#0194

    python - <script>python <script> > <path> <n> >& <path>
  142. Other · Runtime processes

    Requested script or workload execution related to runtime processes.

    1 call · #0195–#0195

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

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

    4 calls · #0196–#0199

    cat <path>tail -n <n> <path>rg --files <val>rg <val>rg -n <val> -A <n> <path>rg -n <val> <path> <path>
    2 more command sketches
    rg --files <path>sed -n <val> <path>
  144. Inspect · Optimizer & gradients

    1 tool error

    Requested source searches related to optimizer & gradients.

    1 call · #0200–#0200

    rg -n -A <n> <val> <path>rg -n <val> <path> <path> --glob <path>
  145. Profile · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0201–#0201

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

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

    1 call · #0202–#0202

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

    Requested script or workload execution related to source & workspace.

    2 calls · #0203–#0204

    python - <script>python <script> > <path> <n> >& <path>
  148. Other · Runtime processes

    Requested script or workload execution related to runtime processes.

    1 call · #0205–#0205

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

    Requested script or workload execution related to source & workspace.

    1 call · #0206–#0206

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

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

    2 calls · #0207–#0208

    sed -n <val> <path>rg --files <val>rg <val>rg -n <val> <path> <val> --glob <path>head -n <n>
  151. Other · Source & workspace

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

    2 calls · #0209–#0210

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

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

    4 calls · #0211–#0214

    tail -n <n> <path>git diff --checkgit status --short
  153. Profile · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0215–#0215

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

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

    2 calls · #0216–#0217

    tail -n <n> <path>bash <script> > <path> <n> >& <path>cat <path>
  155. Inspect · Attention kernels

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

    2 calls · #0218–#0219

    git diff --checkgit status --short<command> <args>head -n <n>rg -n <val> <path> <path> <path>
  156. Validate · Checkpoints & weight state

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

    1 call · #0220–#0220

    python - <script>
  157. Inspect · Attention kernels

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

    1 call · #0221–#0221

    rg --files --hidden --no-ignore <path>ps <flag> <args>rg <path>head -n <n>tail -n <n> <path>

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 · 2 changed files

Base commit: df2ea7fad8e43016b0e2edbf7ce16026496df2ae

diff --git a/mindspeed/core/fusions/rotary_pos_embedding.py b/mindspeed/core/fusions/rotary_pos_embedding.pyindex e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..42c9f16d0777af5c65f823f41a588ad8613f34c6 100644--- a/mindspeed/core/fusions/rotary_pos_embedding.py+++ b/mindspeed/core/fusions/rotary_pos_embedding.py@@ -0,0 +1,41 @@+"""Preparation shared by rotary embedding implementations."""++import torch+from torch import Tensor+++def get_rotary_cos_sin(freqs: Tensor, dtype: torch.dtype, mscale: float = 1.0):+    """Reuse constant trigonometric tables for the lifetime of a frequency tensor.++    Decoder layers share their frequency tensor. Keeping a single entry on that+    tensor avoids retaining tables from previous forwards in a global cache.+    Trainable frequencies and inference tensors must not retain autograd state+    or supply inference-only tensors to a later training forward.+    """+    cacheable = (+        not freqs.requires_grad+        and not isinstance(mscale, Tensor)+        and not torch.is_inference_mode_enabled()+        and not freqs.is_inference()+    )+    if cacheable:+        key = (+            freqs._version,+            freqs.data_ptr(),+            freqs.shape,+            freqs.stride(),+            freqs.dtype,+            freqs.device,+            dtype,+            mscale,+        )+        cached = getattr(freqs, "_mindspeed_rotary_cos_sin", None)+        if cached is not None and cached[0] == key:+            return cached[1]++    cos = (torch.cos(freqs) * mscale).to(dtype)+    sin = (torch.sin(freqs) * mscale).to(dtype)+    result = (cos, sin)+    if cacheable:+        freqs._mindspeed_rotary_cos_sin = (key, result)+    return resultdiff --git a/mindspeed/core/fusions/tests/test_rotary_cache.py b/mindspeed/core/fusions/tests/test_rotary_cache.pynew file mode 100644index 0000000000000000000000000000000000000000..1eabcf8f187440b573b147b16ec1b253e1d524ba--- /dev/null+++ b/mindspeed/core/fusions/tests/test_rotary_cache.py@@ -0,0 +1,90 @@+"""Regression tests for sharing constant RoPE tables across decoder layers."""++import weakref++import pytest+import torch++from mindspeed.core.fusions.rotary_pos_embedding import get_rotary_cos_sin+++def assert_tables_equal(freqs, dtype, scale, tables):+    expected = ((freqs.cos() * scale).to(dtype), (freqs.sin() * scale).to(dtype))+    for actual, reference in zip(tables, expected):+        torch.testing.assert_close(actual, reference, rtol=0, atol=0)+++@pytest.mark.parametrize("dtype", [torch.float32, torch.float16, torch.bfloat16])+@pytest.mark.parametrize("scale", [1.0, 1.25])+def test_constant_tables_are_reused(dtype, scale):+    freqs = torch.linspace(-3.0, 3.0, 128).reshape(8, 1, 1, 16)+    tables = get_rotary_cos_sin(freqs, dtype, scale)+    assert get_rotary_cos_sin(freqs, dtype, scale) is tables+    assert_tables_equal(freqs, dtype, scale, tables)+++def test_mutation_dtype_and_scale_invalidate_cache():+    freqs = torch.arange(16, dtype=torch.float32)+    old = get_rotary_cos_sin(freqs, torch.float32)+    freqs.add_(0.25)+    new = get_rotary_cos_sin(freqs, torch.float32)+    assert new is not old+    assert_tables_equal(freqs, torch.float32, 1.0, new)+    for dtype, scale in [(torch.bfloat16, 1.0), (torch.bfloat16, 1.5)]:+        old, new = new, get_rotary_cos_sin(freqs, dtype, scale)+        assert new is not old+        assert_tables_equal(freqs, dtype, scale, new)+++def test_replacing_storage_invalidates_cache():+    freqs = torch.arange(16, dtype=torch.float32)+    old = get_rotary_cos_sin(freqs, torch.float32)+    freqs.data = freqs.data + 0.5+    new = get_rotary_cos_sin(freqs, torch.float32)+    assert new is not old+    assert_tables_equal(freqs, torch.float32, 1.0, new)+++def test_trainable_frequencies_support_repeated_backward():+    freqs = torch.arange(16, dtype=torch.float64, requires_grad=True)+    reference = freqs.detach().clone().requires_grad_()+    for _ in range(2):+        cos, sin = get_rotary_cos_sin(freqs, freqs.dtype, 1.25)+        (cos + sin).sum().backward()+        ((reference.cos() * 1.25) + (reference.sin() * 1.25)).sum().backward()+        torch.testing.assert_close(freqs.grad, reference.grad, rtol=0, atol=0)+    assert not hasattr(freqs, "_mindspeed_rotary_cos_sin")+++def test_tensor_scale_is_not_cached():+    freqs = torch.arange(16, dtype=torch.float32)+    scale = torch.tensor(1.25, requires_grad=True)+    for _ in range(2):+        cos, sin = get_rotary_cos_sin(freqs, freqs.dtype, scale)+        (cos + sin).sum().backward()+    assert scale.grad is not None+    assert not hasattr(freqs, "_mindspeed_rotary_cos_sin")+++def test_inference_tables_do_not_leak_into_training():+    freqs = torch.arange(16, dtype=torch.float32)+    with torch.inference_mode():+        cos, _ = get_rotary_cos_sin(freqs, freqs.dtype)+        assert cos.is_inference()+        inference_freqs = freqs.clone()+    assert not hasattr(freqs, "_mindspeed_rotary_cos_sin")+    for source in (freqs, inference_freqs):+        cos, _ = get_rotary_cos_sin(source, source.dtype)+        assert not cos.is_inference()+        x = torch.ones_like(cos, requires_grad=True)+        (x * cos).sum().backward()+        torch.testing.assert_close(x.grad, cos, rtol=0, atol=0)+++def test_cache_does_not_retain_frequency_tensors():+    freqs = torch.arange(16, dtype=torch.float32)+    ref = weakref.ref(freqs)+    tables = get_rotary_cos_sin(freqs, freqs.dtype)+    del freqs+    assert ref() is None+    assert tables[0].numel() == 16
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..d12ed3c6867d9341939b69233af107602b20a939 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.rotary_pos_embedding import get_rotary_cos_sin from mindspeed_llm.tasks.common.yarn_rope import YarnRotaryPositionEmbedding  @@ -255,8 +256,7 @@ def apply_rotary_pos_emb_bshd(         *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_ = get_rotary_cos_sin(freqs, t.dtype, _mscale)          if args.use_fused_rotary_pos_emb:         mode = 1 if rotary_interleaved else 0@@ -264,7 +264,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.shape[-1] else t   def apply_rotary_pos_emb_thd(@@ -292,7 +292,10 @@ def apply_rotary_pos_emb_thd(         # when args.reset_position_ids is False, use chunk is faster.         cp_size = parallel_state.get_context_parallel_world_size()         cp_rank = parallel_state.get_context_parallel_rank()-        freqs = freqs.chunk(cp_size, dim=0)[cp_rank]+        # Keep the shared tensor when no partitioning is needed so all layers+        # can reuse its constant sine/cosine tables.+        if cp_size > 1:+            freqs = freqs.chunk(cp_size, dim=0)[cp_rank]      return apply_rotary_pos_emb_bshd(t, freqs, rotary_interleaved, multi_latent_attention, mscale) @@ -315,4 +318,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/training/utils.py b/mindspeed_llm/training/utils.pyindex c779adfcf9140eff6e1cae1ac28f45027763ff74..4e8d7b7c3324652a558993b81fd5607c3758f2a1 100644--- a/mindspeed_llm/training/utils.py+++ b/mindspeed_llm/training/utils.py@@ -587,7 +587,16 @@ def get_batch_on_this_tp_rank(data_iterator):         else:             _broadcast(batch['attention_mask'])         if args.reset_attention_mask:-            actual_seq_len = broadcast_dynamic(data['actual_seq_len'])+            if (mpu.get_tensor_model_parallel_world_size() == 1+                    and args.context_parallel_size == 1+                    and not args.mtp_num_layers):+                # FlashAttention takes cumulative lengths as host integers.+                # The dataloader already supplies them on the host; without+                # TP broadcast or CP padding there is no device work to do on+                # this metadata. Avoid an H2D/D2H round trip and stream sync.+                actual_seq_len = data['actual_seq_len']+            else:+                actual_seq_len = broadcast_dynamic(data['actual_seq_len'])             if args.attention_mask_type == 'causal' \               and args.context_parallel_size > 1 \               and args.context_parallel_algo == 'megatron_cp_algo':@@ -1111,4 +1120,4 @@ def check_pipeline_config(num_layers, pp, vpp_stage, noop_layers):                         f"Interception Error: VPP Stage {vpp_idx} in PP Stage {pp_idx} consists entirely of empty layers!\n"                         f"Corresponding logical layer indices: {vpp_layers}\n"                         f"Please modify noop_layers or vpp_stage."-                    )\ No newline at end of file+                    )diff --git a/pretrain_gpt.py b/pretrain_gpt.pyindex 5a8506bb3f73e23ca5e1c1e2562d0a861c433cfb..2dc0b226af2244ec57aef037c16ac1ae613cf48b 100644--- a/pretrain_gpt.py+++ b/pretrain_gpt.py@@ -306,4 +306,11 @@ def main():   if __name__ == "__main__":-    main()+    try:+        main()+    finally:+        # Shut down collectives while Python and the device runtime are still+        # alive, including normal checkpoint/exit-interval SystemExit paths.+        if torch.distributed.is_initialized():+            torch.cuda.synchronize()+            torch.distributed.destroy_process_group()