DeepSeek-V4-Pro · Training

T02 · TP2

Valid

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

1.13×PERFORMANCE RATIO
181TOOL EVENTS
1TEXT 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 agentDeepSeek-V4-Pro · 181 visible calls

InspectEditValidateExecuteBuildProfileRollbackOther
151Inspect
1Build
10Validate
1Execute
9Profile
9Other

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 timeline95 groups · 181 calls

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

Main agent

  1. Inspect · Task requirements

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

    1 call · #0001–#0001

    echo <val>ls -l -a <val> <n> > <path>truecat <path> <n> > <path>echo <flag>
  2. Inspect · Source & workspace

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

    2 calls · #0002–#0003

    ls -l -a <path>headcd <val><command> <args>sed -n <val> <val>
  3. Inspect · Checkpoints & weight state

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

    1 call · #0004–#0004

    cd <val>echo <flag>cat <path>echo
  4. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0005–#0005

    cd <val>wc -l <path> <path>sed -n <val> <path>
  5. Inspect · Task requirements

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

    1 call · #0006–#0006

    cd <val>find <val> -maxdepth <n> -type <val> <flag> <args>sortecho <flag>find <path> -maxdepth <n> -type <val> -exec <val> <val> <val><command> <args>
    1 more command sketches
    head -c <n>
  6. Inspect · Source & workspace

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

    7 calls · #0007–#0013

    cd <val>sed -n <val> <path>cat <path>envgrep -E <val>sort
    10 more command sketches
    echocat <path> <n> > <path>headbash <script> <n> >& <path>tail -n <n>bash <script>echo <val>ls -l -a <val>head -n <n>cat <val>
  7. Validate · Benchmark & validation setup

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

    1 call · #0014–#0014

    cd <val><command> <args>env <vars>echo <val>cat <path>head -n <n>
    3 more command sketches
    echo <flag>cat <path> <n> > <path>ls -l -a <val>
  8. Inspect · Source & workspace

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

    1 call · #0015–#0015

    cd <path>git status --shortecho <flag>lssed -n <val> <path>
  9. Build · Dependencies & build setup

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

    1 call · #0016–#0016

    cd <path>git status --shortecho <flag>lssed -n <val> <path> <n> > <path>
  10. Inspect · Benchmark & validation setup

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

    1 call · #0017–#0017

    cd <val>grep -E <val> <val>head -n <n>tail -n <n> <val>echo <flag>head -n <n> <val>
  11. Execute · Benchmark & validation setup

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

    1 call · #0018–#0018

    cd <val><command> <args>env <vars>echo <val>tail -n <n> <path>echo <flag>
    3 more command sketches
    cat <path> <n> > <path>python3 -m <module>head -n <n>
  12. Inspect · Source & workspace

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

    8 calls · #0019–#0026

    cd <path>find <val> -maxdepth <n> -type <val>sed <val>head -n <n>echo <flag>find <path> -type <val>
    9 more command sketches
    headfind <path> -type <val> -maxdepth <n>sortsed -n <val> <path>sed -n <val> <path> <n> > <path>ls <path>grep -R <val> -n <path> <val>cat <path>grep -n <val> -n <path>
  13. Inspect · Dependencies & build setup

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

    1 call · #0027–#0027

    cd <path>sed -n <val> <path>echo <flag>
  14. Inspect · Attention kernels

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

    1 call · #0028–#0028

    cd <path>grep -R <val> -n <val> <val> <n> > <path>head -n <n>
  15. Inspect · Source & workspace

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

    5 calls · #0029–#0033

    cd <path>grep -R <val> -n <val> <val>head -n <n>find <path> -name <path>wc -lgrep -R <val> -n <path>
    1 more command sketches
    sed -n <val> <path>
  16. Profile · Attention kernels

    Requested environment setup or inspection related to attention kernels.

    1 call · #0034–#0034

    cd <path>env <vars> python3 - <script>
  17. Inspect · Source & workspace

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

    2 calls · #0035–#0036

    python3 -c <script> <n> >& <path>tail -n <n>echo <val>find <path> -name <val> -o -name <val> <n> > <path>headpython3 -c <script>
    1 more command sketches
    tr <val> <val>
  18. Other · Source & workspace

    Requested script or workload execution and environment setup or inspection related to source & workspace.

    1 call · #0037–#0037

    which <val>python3 -c <script>env <val> -c <val>
  19. Profile · Source & workspace

    Requested environment setup or inspection related to source & workspace.

    1 call · #0038–#0038

    cd <path>env <vars> python3 - <script>
  20. Inspect · Source & workspace

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

    1 call · #0039–#0039

    python3 -c <script>head -n <n>echo <flag>env <vars> python3 -c <script>
  21. Other · Source & workspace

    Requested script or workload execution, environment setup or inspection and source searches related to source & workspace.

    3 calls · #0040–#0042

    python3 -c <script>echo <val>env <vars> python3 -c <script>envgrep <val>
  22. Profile · Attention kernels

    Requested environment setup or inspection related to attention kernels.

    1 call · #0043–#0043

    cd <path>env <vars> python3 - <script>
  23. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    5 calls · #0044–#0048

    cd <path><command> <args>sed -n <val> <val>sed -n <val> <path>echo <flag>
  24. Inspect · Parallelism & communication

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

    1 call · #0049–#0049

    cd <path>sed -n <val> <path>echo <flag>find <path> -path <val> -o -name <val>grep -R <val> -n <path> <path>head -n <n>
  25. Inspect · Source & workspace

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

    1 call · #0050–#0050

    cd <path>grep -R <val> -n <val>head -n <n>grep -R <val> -n <val> <val> <n> > <path>
  26. Inspect · Parallelism & communication

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

    4 calls · #0051–#0054

    cd <path>sed -n <val> <path>echo <flag>find <path> -maxdepth <n> -type <val>grep -E <val>sort
    3 more command sketches
    <command> <args>sed -n <val> <val>cat <path>
  27. Profile · Source & workspace

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

    1 call · #0055–#0055

    cat > <path> <script>python3 -m <module> <script>echo <val>
  28. Inspect · Source & workspace

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

    6 calls · #0056–#0061

    cd <val><command> <args>tail -n <n> <path>env <vars>echo <val>ls -l <val>
    2 more command sketches
    tail -n <n> <val> <n> > <path>echo <val> <val>
  29. Inspect · Optimizer & gradients

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

    3 calls · #0062–#0064

    cd <val><command> <args>echo <val>tail -n <n> <path>cd <path>grep -R <val> -n <val> <val> <val> <n> > <path>
    4 more command sketches
    head -n <n>grep -n <val> -R <val> <val> <val> <n> > <path>sed -n <val> <path>grep -R <val> -n <path>
  30. Profile · Optimizer & gradients

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

    1 call · #0065–#0065

    cat > <path> <script>python3 <script> <val> <n> <val> <val> > <path> <n> >& <path>echo <val>tail -n <n> <path>
  31. Inspect · Dependencies & build setup

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

    1 call · #0066–#0066

    cd <val>grep -E <val> <val>head -n <n>ls -l -a <path>find <path> -maxdepth <n> -name <val> <flag> <args>
  32. Inspect · Source & workspace

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

    2 calls · #0067–#0068

    cd <path>grep -n <val> -R <path> <path> <path>head -n <n>cd <val><command> <args>echo <val>
    2 more command sketches
    grep -n <val> <path>ls -l <path>
  33. Inspect · Optimizer & gradients

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

    1 call · #0069–#0069

    cd <val>grep -n <val> <val>tail -n <n>
  34. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0070–#0070

    cd <val>sed -n <val> <val>
  35. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    2 calls · #0071–#0072

    cd <path>sed -n <val> <path>echo <flag>
  36. Inspect · Source & workspace

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

    6 calls · #0073–#0078

    cd <val><command> <args>echo <val>tail -n <n> <path>cd <path>sed -n <val> <path>
    8 more command sketches
    find <path> -maxdepth <n> -type <val> -name <val> -o -name <val> -o <args>sortgrep -R <val> -n <path> <path>head -n <n>headgrep -R <val> -n <val> <val> <n> > <path>cat <path>grep -R <val> -n <path>
  37. Inspect · Attention kernels

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

    3 calls · #0079–#0081

    cd <path>grep -n <val> -R <val> <val>headsed -n <val> <path>grep -n <val> -R <val> <val> <n> > <path>head -n <n>
    1 more command sketches
    grep -R <val> -n <path> <path>
  38. Inspect · Source & workspace

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

    3 calls · #0082–#0084

    cd <path>cat <path>grep -R <val> -n <val> <val> <val> <n> > <path>head -n <n>grep -n <val> <path>sed -n <val> <path>
    5 more command sketches
    grep -n <val> -R <path> <path>cd <val><command> <args>echo <val>tail -n <n> <path>
  39. Inspect · Parallelism & communication

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

    1 call · #0085–#0085

    cd <path>grep -n <val> -R <path> <path>head -n <n>grep -n <val> <path>
  40. Inspect · Source & workspace

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

    1 call · #0086–#0086

    cd <path>grep -R <val> -n <path> <path>head -n <n>grep -n <val> -n <path>headsed -n <val> <path>
  41. Inspect · Parallelism & communication

    Requested file and log inspection related to parallelism & communication.

    1 call · #0087–#0087

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

    Requested file and log inspection related to source & workspace.

    4 calls · #0088–#0091

    cd <val><command> <args>echo <val>tail -n <n> <path>
  43. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    8 calls · #0092–#0099

    cd <val><command> <args>echo <val>tail -n <n> <path>
  44. Inspect · Parallelism & communication

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

    1 call · #0100–#0100

    cd <path>grep -n <val> -n <path> <path> <path>head -n <n>
  45. Inspect · Source & workspace

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

    1 call · #0101–#0101

    cd <path>grep -R <val> -n <val> <val> <val> <n> > <path>head -n <n>
  46. Inspect · Parallelism & communication

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

    2 calls · #0102–#0103

    cd <path>sed -n <val> <path>grep -n <val> -n <path>head -n <n>
  47. Inspect · Batching & scheduling

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

    1 call · #0104–#0104

    cd <val><command> <args>echo <val>grep -n <val> <path>tail -n <n>tail -n <n> <path>
  48. Inspect · Parallelism & communication

    Requested file and log inspection related to parallelism & communication.

    1 call · #0105–#0105

    cd <path>sed -n <val> <path>
  49. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    2 calls · #0106–#0107

    cd <val><command> <args>echo <val>tail -n <n> <path>
  50. Inspect · Attention kernels

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

    1 call · #0108–#0108

    cd <path>grep -R <val> -n <path>sed -n <val> <path> <n> > <path>find <path> -name <val> -type <val> -maxdepth <n>grep -R <val> -n <val> <val> <n> > <path>head -n <n>
  51. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    1 call · #0109–#0109

    cd <val><command> <args>echo <val>tail -n <n> <path>
  52. Inspect · Source & workspace

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

    2 calls · #0110–#0111

    cd <path>grep -n <val> -n <path>head -n <n>sed -n <val> <path>
  53. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    2 calls · #0112–#0113

    cd <val><command> <args>echo <val>tail -n <n> <path>
  54. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0114–#0114

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

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

    1 call · #0115–#0115

    cd <path>grep -R <val> -n <val> <path> <path> <n> > <path>head -n <n>grep -R <val> -n <path> <path>
  56. Other · Optimizer & gradients

    Requested script or workload execution related to optimizer & gradients.

    2 calls · #0116–#0117

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

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

    1 call · #0118–#0118

    grep -R <val> -n <path> <n> > <path>head -n <n>python3 - <script>
  58. Inspect · Source & workspace

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

    2 calls · #0119–#0120

    ls <path>head -n <n>find <path> -maxdepth <n> -type <val>grep -E <val>cd <path>sed -n <val> <path>
    1 more command sketches
    grep -n <val> -n <path>
  59. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    1 call · #0121–#0121

    cd <val><command> <args>echo <val>tail -n <n> <path>
  60. Inspect · Device memory

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

    2 calls · #0122–#0123

    cd <path>grep -R <val> -n <val> <val> <n> > <path>sed -n <val> <path>grep -n <val> -n <path> <path> -Rhead -n <n>grep -R <val> -n <path>
  61. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0124–#0124

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

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

    4 calls · #0125–#0128

    cat > <path> <script>python3 <script>echo <val>grep -R <val> -n <path> <path> <path> <n> > <path>head -n <n>grep -n <val> <path>
    4 more command sketches
    headgrep -n <val> -R <path> <path> <n> > <path>grep -n <val> -R <path> <n> > <path>grep -R <val> -n <path> <path> <n> > <path>
  63. Profile · Checkpoints & weight state

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

    1 call · #0129–#0129

    cat > <path> <script>cd <val><command> <args>echo <val>tail -n <n> <path>
  64. Inspect · Source & workspace

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

    1 call · #0130–#0130

    ps <flag> <args>grep -E <val>grep -v <val>echo <flag>ls -l <path> <n> > <path>tail -n <n> <path> <n> > <path>
    1 more command sketches
    cat <path> <n> > <path>
  65. Inspect · Checkpoints & weight state

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

    1 call · #0131–#0131

    ls -l -a <path> <n> > <path>find <path> -maxdepth <n> -type <val> <n> > <path>head -n <n>grep -n <val> <path> <n> > <path>tail -n <n> <path> <n> > <path>grep -E <val>
  66. Profile · Checkpoints & weight state

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

    2 calls · #0132–#0133

    cd <val>env <vars> python3 - <script>cat > <path> <script>python3 <script> <val> <val> > <path> <n> >& <path>echo <val>tail -n <n> <path>
  67. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    1 call · #0134–#0134

    cd <val><command> <args>echo <val>tail -n <n> <path>
  68. Inspect · Parallelism & communication

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

    1 call · #0135–#0135

    grep -R <val> -n <path> <path> <path> <n> > <path>head -n <n>
  69. Inspect · Source & workspace

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

    1 call · #0136–#0136

    cd <path>grep -n <val> -R <val> <val> <val> <n> > <path>head -n <n>grep -n <val> <path>
  70. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    1 call · #0137–#0137

    cd <val><command> <args>echo <val>tail -n <n> <path>
  71. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0138–#0138

    cd <path>sed -n <val> <path>
  72. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    1 call · #0139–#0139

    cd <val><command> <args>echo <val>tail -n <n> <path>
  73. Inspect · Source & workspace

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

    1 call · #0140–#0140

    cat > <path> <script>python3 <script>
  74. Inspect · Attention kernels

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

    3 calls · #0141–#0143

    cat > <path> <script>python3 <script>
  75. Inspect · Source & workspace

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

    4 calls · #0144–#0147

    cd <path>cat <path>grep -R <val> -n <val> <val> <n> > <path>head -n <n>sed -n <val> <path>grep -R <val> -n <val> <val> <val> <n> > <path>
    1 more command sketches
    grep -n <val> <path>
  76. Other · Source & workspace

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

    1 call · #0148–#0148

    cd <path>python3 - <script>grep -n <val> <path>
  77. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    1 call · #0149–#0149

    cd <val><command> <args>echo <val>tail -n <n> <path>
  78. Inspect · Optimizer & gradients

    Requested file and log inspection related to optimizer & gradients.

    1 call · #0150–#0150

    cd <val><command> <args>echo <val>tail -n <n> <path>
  79. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    1 call · #0151–#0151

    cd <val><command> <args>echo <val>tail -n <n> <path>
  80. Inspect · Source & workspace

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

    1 call · #0152–#0152

    cd <path>python3 - <script>grep -n <val> <path>git diff <flag> <args>head
  81. Inspect · Parallelism & communication

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

    1 call · #0153–#0153

    cd <path>ls <path>xargs <flag> <args>sortgrep -R <val> -n <val> <val> <n> > <path>head -n <n>
  82. Inspect · Attention kernels

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

    1 call · #0154–#0154

    cd <path>grep -R <val> -n <val> <val> <n> > <path>head -n <n>sed -n <val> <path>
  83. Inspect · Source & workspace

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

    4 calls · #0155–#0158

    cd <path>grep -n <val> -R <val> <val>sed -n <val> <path>grep -n <val> -C <n>grep -R <val> -n <path> <path><command> <args>
    1 more command sketches
    sed -n <val>
  84. Inspect · Batching & scheduling

    Requested file and log inspection related to batching & scheduling.

    2 calls · #0159–#0160

    cd <val><command> <args>echo <val>tail -n <n> <path>
  85. Inspect · Source & workspace

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

    2 calls · #0161–#0162

    cd <path>git status --shortsed -n <val> <path>
  86. Inspect · Checkpoints & weight state

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

    1 call · #0163–#0163

    cd <path>python3 - <script>sed -n <val> <path>
  87. Inspect · Source & workspace

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

    3 calls · #0164–#0166

    cd <path>sed -n <val> <path>python3 -m <module> <script>echo <val>grep -n <val> <flag> <args>head -n <n>
  88. Inspect · Batching & scheduling

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

    1 call · #0167–#0167

    cd <val><command> <args>echo <val>tail -n <n> <path>grep -n <val> <path>head -n <n>
  89. Inspect · Source & workspace

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

    2 calls · #0168–#0169

    cd <path>cat <path>grep -R <val> -n <path> <path>head -n <n>grep -n <val> -R <val> <val>grep -n <val> -n <path> <path>
  90. Inspect · Parallelism & communication

    Requested script or workload execution and file and log inspection related to parallelism & communication.

    1 call · #0170–#0170

    cd <path>python3 - <script>sed -n <val> <path>python3 -m <module> <script>echo <val>
  91. Inspect · Batching & scheduling

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

    1 call · #0171–#0171

    cd <val><command> <args>echo <val>tail -n <n> <path>grep -n <val> <path>head -n <n>
  92. Validate · Benchmark & validation setup

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

    2 calls · #0172–#0173

    cd <val><command> <args>env <vars>echo <val>tail -n <n> <path>echo <flag>
    9 more command sketches
    cat <path> <n> > <path>python3 -m <module>head -n <n>ps <flag> <args>grep -E <val>grep -v <val>echols -l <path>tail -n <n> <path> <n> > <path>
  93. Validate · Checkpoints & weight state

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

    1 call · #0174–#0174

    grep -n <val> <path>tail -n <n>ls -l -a <path>find <path> -type <val> -maxdepth <n> <flag> <args>cat <path> <n> > <path>
  94. Profile · Checkpoints & weight state

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

    1 call · #0175–#0175

    cat > <path> <script>cd <val><command> <args>echo <val>tail -n <n> <path>
  95. Validate · Checkpoints & weight state

    1 missing return

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

    6 calls · #0176–#0181

    cd <val>cat <val> <n> > <path>tail -n <n>ls -l -a <path> <n> > <path>grep -n <val> <val>ps <flag> <args>
    14 more command sketches
    grep -E <val>grep -v <val>truerm -rf <path> <path> <path>nohup <val> <path> > <path> <n> >& <path>echo <val>sleep <n>ps <flag>echo <flag>tail -n <n> <path> <n> > <path>cat <path> <n> > <path>head -n <n>echols <path> <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_llm · 1 changed files

Base commit: 72c49a6260c73669678b8f39b1ba41a4789bb555

diff --git a/mindspeed_llm/training/training.py b/mindspeed_llm/training/training.pyindex 66cfad6ad3511eda039cde69f087680f1315304e..83077d2df66511bb7feab398b6ae6fa5df45a8b9 100644--- a/mindspeed_llm/training/training.py+++ b/mindspeed_llm/training/training.py@@ -35,7 +35,11 @@ from megatron.training import get_signal_handler from megatron.training import get_tensorboard_writer from megatron.training import get_wandb_writer from megatron.training import one_logger_utils-from megatron.core.num_microbatches_calculator import get_num_microbatches, update_num_microbatches+from megatron.core.num_microbatches_calculator import (+    get_num_microbatches,+    reconfigure_num_microbatches_calculator,+    update_num_microbatches,+) from megatron.core import mpu, parallel_state from megatron.core.utils import get_model_config from megatron.core.enums import ModelType@@ -82,6 +86,142 @@ except Exception as e:     pass  +_GIB = 1024 ** 3+++def _apply_npu_local_training_optimizations(args):+    """Select a larger gradient-accumulation microbatch when NPU memory allows.++    Megatron-Core processes the public ``micro_batch_size == 1`` workload as a+    sequence of tiny [seq, 1, hidden] matmuls.  Running several samples in one+    microbatch keeps the same global batch, gradient accumulation, optimizer+    update, and loss normalization while using the NPU matrix units more+    efficiently.  The choice is guarded by a model-size/memory estimate so it+    only applies to dense local-transformer runs on devices with enough HBM.++    Gradient accumulation fusion is enabled alongside the larger microbatch:+    on Ascend it is serviced by the task-owned ``npu_matmul_add`` operator and+    accumulates weight gradients in-place, avoiding one GEMM plus a separate+    add for every linear layer and microbatch.+    """+    if args.use_legacy_models:+        return+    if getattr(args, "transformer_impl", None) != "local":+        return+    if not getattr(args, "bf16", False) or not getattr(args, "use_distributed_optimizer", False):+        return+    if getattr(args, "pipeline_model_parallel_size", 1) != 1:+        return+    if getattr(args, "context_parallel_size", 1) != 1:+        return+    if getattr(args, "sequence_parallel", False):+        return+    if getattr(args, "recompute_granularity", None) is not None:+        return+    if getattr(args, "num_experts", None) is not None:+        return+    if getattr(args, "mtp_num_layers", None) is not None:+        return+    if getattr(args, "micro_batch_size", None) != 1:+        return++    global_batch_size = getattr(args, "global_batch_size", None)+    tensor_parallel_size = getattr(args, "tensor_model_parallel_size", None)+    if not global_batch_size or not tensor_parallel_size:+        return+    if global_batch_size % 4 != 0:+        return++    hidden_size = getattr(args, "hidden_size", None)+    ffn_hidden_size = getattr(args, "ffn_hidden_size", None)+    num_layers = getattr(args, "num_layers", None)+    vocab_size = getattr(args, "vocab_size", None)+    num_query_groups = getattr(args, "num_query_groups", None)+    kv_channels = getattr(args, "kv_channels", None)+    seq_length = getattr(args, "seq_length", None)+    if not all(+        isinstance(value, (int, float))+        for value in (+            hidden_size,+            ffn_hidden_size,+            num_layers,+            vocab_size,+            num_query_groups,+            kv_channels,+            seq_length,+        )+    ):+        return++    try:+        device_index = torch_npu.npu.current_device()+        device_properties = torch_npu.npu.get_device_properties(device_index)+        total_memory = int(device_properties.total_memory)+    except Exception:+        return+    if total_memory <= 0:+        return++    # Dense GPT-style parameters (biases and the small norms are intentionally+    # omitted, which keeps this estimate conservative).+    hidden_size = int(hidden_size)+    ffn_hidden_size = int(ffn_hidden_size)+    num_layers = int(num_layers)+    vocab_size = int(vocab_size)+    num_query_groups = int(num_query_groups)+    kv_channels = int(kv_channels)+    seq_length = int(seq_length)+    tensor_parallel_size = int(tensor_parallel_size)++    attention_params = (+        2 * hidden_size * hidden_size+        + hidden_size * (2 * num_query_groups * kv_channels)+    )+    mlp_params = hidden_size * (3 * ffn_hidden_size)+    layer_params = attention_params + mlp_params+    embedding_params = vocab_size * hidden_size+    resident_params = (+        embedding_params + num_layers * layer_params+    ) / tensor_parallel_size++    # BF16 weights/grads plus FP32 master weights and Adam moments.+    resident_bytes = resident_params * 18+    # One input/gradient activation per layer plus attention and MLP+    # intermediates.  This is deliberately conservative: failing this check+    # leaves the public execution path unchanged.+    activation_bytes = seq_length * 4 * hidden_size * num_layers * 20+    required_bytes = resident_bytes + activation_bytes + 3 * _GIB+    if required_bytes > total_memory:+        return++    original_gradient_accumulation_fusion = bool(+        getattr(args, "gradient_accumulation_fusion", False)+    )+    args.micro_batch_size = 4+    args.gradient_accumulation_fusion = True+    try:+        reconfigure_num_microbatches_calculator(+            int(getattr(args, "rank", 0)),+            getattr(args, "rampup_batch_size", None),+            int(global_batch_size),+            args.micro_batch_size,+            int(getattr(args, "data_parallel_size", 1)),+            bool(getattr(args, "decrease_batch_size_if_needed", False)),+        )+    except Exception:+        # Keep the public execution path if the microbatch calculator cannot+        # be safely reconfigured.+        args.micro_batch_size = 1+        args.gradient_accumulation_fusion = original_gradient_accumulation_fusion+        return+    if getattr(args, "rank", 0) == 0:+        print(+            "[MindSpeed NPU tuning] using micro batch size 4 with gradient "+            "accumulation fusion for the local transformer path",+            flush=True,+        )++ def update_save_checkpoint_chmod(save_path, permission=0o640):     args = get_args()     if args.enable_high_availability:@@ -428,6 +568,7 @@ def pretrain(train_valid_test_dataset_provider,     args = get_args()     timers = get_timers() +    _apply_npu_local_training_optimizations(args)      if args.log_progress:         append_to_progress_log("Starting job")