Kimi K3 · Training

T03 · Packed DP2

Valid

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

1.23×PERFORMANCE RATIO
288TOOL EVENTS
2TEXT PATCHES
0BINARY NAMES

01 / PROCESS MAP

Agents over time

Compare agents on one time axis; overlapping spans line up vertically. Select an agent or bar to inspect its events.

Elapsed time · mm:ss

Agent / model
+02:55+03:03+03:10+03:18+03:25
Main agentKimi K3Main timeline · 288 calls
Subagent 1Model not recordedFrom Main agent · 0 calls
Delegation only · child timing not recorded

Time starts at the first recorded activity. Select a bar or agent to open its events. Bars span the first and last recorded observation, including gaps; colored ticks mark tool calls. A hollow diamond marks a delegation whose child timing is unavailable.

InspectEditValidateExecuteBuildProfileRollbackOther
229Inspect
19Edit
3Build
9Validate
9Execute
3Rollback
16Other

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 timeline144 groups · 288 calls · 1 subagents

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>. Each branch belongs to its named agent. Expand a delegation to inspect its child; branches can run concurrently. Call numbers preserve source order, not a serial schedule. Times are relative to the first recorded activity.

Main agent

  1. Inspect · Source & workspace

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

    4 calls · #0001–#0004

    Read <path>ls <path>
  2. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0005–#0005

    Read <path>
  3. Inspect · Optimizer & gradients

    Requested workspace inspection related to optimizer & gradients.

    1 call · #0006–#0006

    ls <path> <path> <path> <path> <path>
  4. Inspect · Source & workspace

    Requested workspace inspection related to source & workspace.

    1 call · #0007–#0007

    ls <path>ls <path> <n> > <path>
  5. Inspect · Attention kernels

    Requested source searches related to attention kernels.

    1 call · #0008–#0008

    Search <pattern> <path>
  6. Inspect · Parallelism & communication

    Requested workspace inspection related to parallelism & communication.

    1 call · #0009–#0009

    ls <path> <path> <path> <path> <n> > <path>
  7. Inspect · Attention kernels

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

    8 calls · #0010–#0017

    Search <pattern> <path>Read <path>
  8. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    2 calls · #0018–#0019

    Read <path>
  9. Inspect · Dependencies & build setup

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

    1 call · #0020–#0020

    pip show <val> <n> > <path>head -n <n>python -c <script> <n> > <path>ls <path> <n> > <path>head
  10. Inspect · Source & workspace

    Requested source searches related to source & workspace.

    1 call · #0021–#0021

    Search <pattern> <path>
  11. Execute · Source & workspace

    Requested service requests and workspace inspection related to source & workspace.

    1 call · #0022–#0022

    cd <path>curl <flag> <args>ls -l -a <val>
  12. Inspect · Optimizer & gradients

    Requested file and log inspection related to optimizer & gradients.

    1 call · #0023–#0023

    Read <path>
  13. Execute · Source & workspace

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

    2 calls · #0024–#0025

    cd <path>cat <val>echocurl <flag> <args>head -n <n>echo <flag>
    1 more command sketches
    <command> <args>
  14. Inspect · Dependencies & build setup

    1 tool error

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

    1 call · #0026–#0026

    cd <path>pip <val> <val> --no-deps <flag> <args>tail -n <n>pip <val> <val> --no-deps -d <path> <n> >& <path>
  15. Build · Dependencies & build setup

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

    1 call · #0027–#0027

    grep -i <val> <path>head -n <n>grep -r -i <val> <path>git -C <path> <val> --oneline
  16. Inspect · Dependencies & build setup

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

    1 call · #0028–#0028

    cd <path>pip <val> <val> --no-deps <flag> <args>tail -n <n>ls <path>
  17. Inspect · Source & workspace

    2 tool errors

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

    4 calls · #0029–#0032

    cd <path>unzip -q <val> -d <val>ls <path>diff <flag> <args>head -n <n>python -c <script>
    3 more command sketches
    grep -v <val>echo <val>grep -c <val>
  18. Execute · Source & workspace

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

    2 calls · #0033–#0034

    cd <path>curl <flag> <args>tar <flag> <args>head -n <n>
  19. Inspect · Source & workspace

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

    7 calls · #0035–#0041

    cd <path>ls -l -a <val>file <val>head -c <n> <val>rm -f <val>git <val> <flag> <args>
    9 more command sketches
    tail -n <n>ls <val> <n> > <path>head -n <n>env <vars> git <val> <flag> <args>diff <flag> <args>grep -v <path>grep -v <val>diff -u <path> <path>wc -l
  20. Build · Dependencies & build setup

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

    1 call · #0042–#0042

    grep -E <val> <path>head -n <n>cat <path> <n> > <path>ls <path> <n> > <path>
  21. Inspect · Source & workspace

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

    1 call · #0043–#0043

    cd <path>env <vars> git <val> <flag> <args>tail -n <n>ls <val>head -n <n>
  22. Build · Dependencies & build setup

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

    1 call · #0044–#0044

    cd <path>env <vars> git <val> <flag> <args>tail -n <n>grep <val> <path>head -n <n>
  23. Rollback · Dependencies & build setup

    Requested environment setup or inspection, file and log inspection and source restoration related to dependencies & build setup.

    1 call · #0045–#0045

    cd <path>env <vars> git fetch <flag> <args>tail -n <n>git checkout -q <val>grep <val> <path>head -n <n>
    3 more command sketches
    diff <flag> <args>grep -v <val>grep <val>
  24. Rollback · Source & workspace

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

    1 call · #0046–#0046

    cd <path>git checkout -q <val>env <vars> git <val> <flag> <args>tail -n <n>ls <path>head -n <n>
  25. Other · Attention kernels

    Requested source searches related to attention kernels.

    1 call · #0047–#0047

    cd <path><command> <args>grep -c <val>echo <val>diff <path> <path> > <path> <n> >& <path>
  26. Inspect · Source & workspace

    1 tool error

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

    6 calls · #0048–#0053

    cd <path>env <vars> git fetch <flag> <args>tail -n <n>git log <flag> <args>head -n <n>rm -rf <val>
    7 more command sketches
    env <vars> git <val> <flag> <args>cd <val>git log --onelinewc -lecho <flag>echo <val>head
  27. Rollback · Source & workspace

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

    1 call · #0054–#0054

    cd <path>git checkout -q <val> <n> >& <path>tail -n <n>diff <flag> <args>grep <val>head -n <n>
  28. Inspect · Source & workspace

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

    3 calls · #0055–#0057

    cd <path>diff <flag> <args>grep <val>sed <path>head -n <n>diff -q <path> <path>
    1 more command sketches
    wc -l
  29. Other · Attention kernels

    Requested source searches related to attention kernels.

    1 call · #0058–#0058

    cd <path><command> <args>grep -c <val>echo <val>
  30. Inspect · Parallelism & communication

    Requested file and log inspection related to parallelism & communication.

    1 call · #0059–#0059

    cd <path><command> <args>diff -u <path> <path>head -n <n>
  31. Inspect · Source & workspace

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

    2 calls · #0060–#0061

    cd <path>diff -u <path> <path>head -n <n>git log <flag> <args>catecho
    1 more command sketches
    wc -l
  32. Inspect · Attention kernels

    Requested repository inspection, file and log inspection and workspace file updates related to attention kernels.

    3 calls · #0062–#0064

    cd <path>git log --format <val> <flag> <args>head -n <n>mkdir -p <path><command> <args>grep -c <val>
    1 more command sketches
    echo <val>
  33. Inspect · Source & workspace

    1 tool error

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

    3 calls · #0065–#0067

    cd <path>git show <path> > <path>diff -u <path> <path>cat > <path> <script>chmod <val> <path><script> <args>
    2 more command sketches
    diff < <path> <val> <path> <path>echo <val>
  34. Other · Attention kernels

    Requested script or workload execution related to attention kernels.

    1 call · #0068–#0068

    <script> <args>
  35. Inspect · Source & workspace

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

    1 call · #0069–#0069

    cd <path>git log <flag> <args>headecho <val>git log --format <val> <flag> <args>head -n <n>
  36. Other · Attention kernels

    Requested script or workload execution related to attention kernels.

    1 call · #0070–#0070

    cd <path><script> <args>
  37. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0071–#0071

    cd <path><script> <args>
  38. Inspect · Source & workspace

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

    2 calls · #0072–#0073

    cd <path>git show <path> > <path>diff -u <path> <path>head -n <n>tail -n <n>
  39. Inspect · Attention kernels

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

    3 calls · #0074–#0076

    cd <path>git show <path> > <path>diff -u <path> <path>head -n <n>sed -n <val>
  40. Inspect · Source & workspace

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

    1 call · #0077–#0077

    cd <path>env <vars> git <val> <flag> <args>tail -n <n>cd <val>git log <flag> <args>
  41. Inspect · Attention kernels

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

    2 calls · #0078–#0079

    cd <path>cat > <path> <script>chmod <val> <path><script> <args>git log <flag> <args>head -n <n>
    1 more command sketches
    ls <path> <n> > <path>
  42. Other · Attention kernels

    Requested tool activity related to attention kernels.

    1 call · #0080–#0080

    cd <path><command> <args>
  43. Inspect · Attention kernels

    Requested file and log inspection and workspace file updates related to attention kernels.

    1 call · #0081–#0081

    cd <path>cat > <path> <script>chmod <val> <path><command> <args>
  44. Other · Source & workspace

    Requested environment setup or inspection related to source & workspace.

    1 call · #0082–#0082

    du <flag> <args>cd <path>env <vars> git <val> -q <flag> <args>echo <val>
  45. Inspect · Source & workspace

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

    7 calls · #0083–#0089

    cd <path>git <val> <val> <val> <url>env <vars> git fetch -q <flag> <args>tail -n <n>git log --format <val> <flag> <args>head -n <n>
    12 more command sketches
    echo <flag>git log <flag> <args><command> <args>wc <flag>echo <val>sort <flag> <args>git diff <flag> <args>git diff <val> <val> <flag> <args>sort -ngrep <val>wc -lgrep -v <val>
  46. Inspect · Attention kernels

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

    1 call · #0090–#0090

    cd <path>git diff <val> <val> <flag> <args>head -n <n>
  47. Inspect · Optimizer & gradients

    Requested file and log inspection and workspace file updates related to optimizer & gradients.

    1 call · #0091–#0091

    cd <path>cat > <path> <script>chmod <val> <path><command> <args>
  48. Edit · Attention kernels

    Requested code edits and script or workload execution related to attention kernels.

    1 call · #0092–#0092

    cd <path>sed -i <path> <path><script> <args>
  49. Inspect · Source & workspace

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

    4 calls · #0093–#0096

    cd <path>git log <flag> <args>head -n <n>ls <path> <n> > <path>ls <path>echo <val>
    2 more command sketches
    Read <path>head -n <n> <path>
  50. Other · Source & workspace

    Requested script or workload execution related to source & workspace.

    1 call · #0097–#0097

    cd <path><script> <args>
  51. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0098–#0098

    cd <path><command> <args>wc <flag>echo <val>sort -u <flag> <args>head -n <n>
  52. Other · Attention kernels

    Requested script or workload execution related to attention kernels.

    1 call · #0099–#0099

    cd <path><script> <args>
  53. Other · Runtime processes

    Requested script or workload execution related to runtime processes.

    1 call · #0100–#0100

    cd <path><script> <args>
  54. Inspect · Source & workspace

    1 tool error

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

    15 calls · #0101–#0115

    cd <path>git show <path>grep -c <val>env <vars> git <val> <flag> <args>awk <val>tail -n <n>
    18 more command sketches
    env <vars> git fetch -q <flag> <args>git log --format <val> <flag> <args>echo <val>git diff <flag> <args>wc -lhead -n <n><command> <args>wc <flag>sort -ngrep <path>grep -v <path>grep <val>grep -n <val>grep -v <val>headls <path> <n> > <path>grep -i <val>grep -i -E <val>
  55. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0116–#0116

    Read <path>
  56. Inspect · Source & workspace

    Requested workspace inspection related to source & workspace.

    1 call · #0117–#0117

    ls <path> <path> <n> > <path>
  57. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0118–#0118

    Read <path>
  58. Inspect · Source & workspace

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

    3 calls · #0119–#0121

    cd <path>env <vars> git fetch -q <flag> <args>tail -n <n>git log <flag> <args>head -n <n>git <val> <val> <val>
    3 more command sketches
    git fetch -q <flag> <args>git log --format <val> <flag> <args>git fetch -q <val> <val> <n> >& <path>
  59. Execute · Source & workspace

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

    1 call · #0122–#0122

    cd <path>curl <flag> <args>grep -n <val> <path>head -n <n>
  60. Inspect · Source & workspace

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

    11 calls · #0123–#0133

    cd <path>git diff <flag> <args>head -n <n>echo <val>wc -lgrep -n <val> <path>
    5 more command sketches
    headsed -n <val> <path>Search <pattern> <path>Read <path>ls <path> <path> <n> > <path>
  61. Inspect · Attention kernels

    Requested source searches related to attention kernels.

    1 call · #0134–#0134

    Search <pattern> <path>
  62. Inspect · Source & workspace

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

    4 calls · #0135–#0138

    Read <path>Search <pattern> <path>
  63. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0139–#0139

    Read <path>
  64. Inspect · Source & workspace

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

    7 calls · #0140–#0146

    git -C <path> <val> <flag>headecho <val>Read <path>Search <pattern> <path>sed -n <val> <path>
  65. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0147–#0147

    Read <path>
  66. Inspect · Source & workspace

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

    6 calls · #0148–#0153

    ls -l -a <path> <n> > <path>headfind <path> -maxdepth <n> <n> > <path>head -n <n>Search <pattern> <path>cd <path>
    5 more command sketches
    echo <val>echo <path>find <path> <path> -maxdepth <n> -name <val> -o -maxdepth <n> -name <val> <args>ls <path> <n> > <path>grep -n <val> <path>
  67. Inspect · Device memory

    Requested file and log inspection related to device memory.

    1 call · #0154–#0154

    Read <path>
  68. Inspect · Source & workspace

    Requested workspace inspection related to source & workspace.

    1 call · #0155–#0155

    echo <val>ls -l -a <val> <n> > <path>
  69. Inspect · Task requirements

    Requested file and log inspection related to task requirements.

    2 calls · #0156–#0157

    Read <path>
  70. Inspect · Source & workspace

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

    6 calls · #0158–#0163

    find <val> -type <val>head -n <n>Read <path>
  71. Inspect · Task requirements

    Requested file and log inspection related to task requirements.

    1 call · #0164–#0164

    Read <path>
  72. Inspect · Checkpoints & weight state

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

    1 call · #0165–#0165

    Read <path>
  73. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0166–#0166

    Read <path>
  74. Other · Source & workspace

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

    1 call · #0167–#0167

    envgrep -E <val>sort
  75. Inspect · Source & workspace

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

    2 calls · #0168–#0169

    cat <path>python3 -m <module>head -n <n>date -ucd <path>git log --oneline <flag> <args>
    2 more command sketches
    git status --short <n> > <path>echo <flag>
  76. Validate · Benchmark & validation setup

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

    1 call · #0170–#0170

    bash <script> > <path> <n> >& <path>echo <val>
  77. Inspect · Source & workspace

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

    2 calls · #0171–#0172

    ls <path>head -n <n>echo <flag>headwc -l <path>Update task list <tasks>
  78. Execute · Source & workspace

    Requested task coordination related to source & workspace.

    1 call · #0173–#0173

    Delegate <task>
    Subagent 1· Model not recorded · explore · 0 visible callsCompleted

    Delegated by Main agent at call #0173.

    Only the returned summary is retained; child tool events are not available.

  79. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0174–#0174

    Read <path>
  80. Validate · Benchmark & validation setup

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

    1 call · #0175–#0175

    cat <path>echo <flag>python3 -m <module> <path> <n> > <path>head -n <n>
  81. Execute · Benchmark & validation setup

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

    1 call · #0176–#0176

    bash <script> > <path> <n> >& <path>echo <val>cp <path> <path> <n> > <path>
  82. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0177–#0177

    Read <path>
  83. Inspect · Source & workspace

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

    5 calls · #0178–#0182

    grep -n <val> <path>head -n <n>Read <path>
  84. Inspect · Attention kernels

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

    6 calls · #0183–#0188

    Read <path>ls <path> <path>echo <flag>grep -r -n <val> <path> <path> <n> > <path>head -n <n>Search <pattern> <path>
  85. Inspect · Source & workspace

    Requested task coordination and source searches related to source & workspace.

    2 calls · #0189–#0190

    Update task list <tasks>Search <pattern> <path>
  86. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0191–#0191

    Read <path>
  87. Inspect · Source & workspace

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

    1 call · #0192–#0192

    grep -n <val> <path>head -n <n>
  88. Inspect · Attention kernels

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

    4 calls · #0193–#0196

    find <path> -maxdepth <n> -name <path>headecho <flag>sed -n <val> <path>grep -n <val> -A <n> <path>grep -n <val> <flag> <args>
    1 more command sketches
    head -n <n>
  89. Inspect · Source & workspace

    Requested source searches related to source & workspace.

    1 call · #0197–#0197

    grep -n <val> <path>
  90. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0198–#0198

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

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

    3 calls · #0199–#0201

    Read <path>grep -n <val> <path> <path>
  92. Execute · Benchmark & validation setup

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

    1 call · #0202–#0202

    tail -n <n> <path>python3 -c <script>
  93. Inspect · Source & workspace

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

    1 call · #0203–#0203

    grep -r -n <val> <path> <path> <path> --include <path>grep -v <val>head -n <n>
  94. Inspect · Attention kernels

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

    3 calls · #0204–#0206

    sed -n <val> <path> <n> > <path>ls <path>sed -n <val> <path>echo <val>Read <path>
  95. Inspect · Source & workspace

    Requested task coordination related to source & workspace.

    1 call · #0207–#0207

    Update task list <tasks>
  96. Inspect · Benchmark & validation setup

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

    1 call · #0208–#0208

    tail -n <n> <path>cut <flag>echo <val>
  97. Inspect · Runtime processes

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

    1 call · #0209–#0209

    grep -r -n <val> <path>headecho <flag>grep -n <val> -A <n> <path>head -n <n>
  98. Inspect · Source & workspace

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

    2 calls · #0210–#0211

    Read <path>grep -n <val> <path>sed -n <val>
  99. Inspect · Parallelism & communication

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

    2 calls · #0212–#0213

    grep -n <val> <path>headRead <path>
  100. Inspect · Runtime processes

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

    1 call · #0214–#0214

    grep -n <val> <path>headsed -n <val> <path>
  101. Inspect · Source & workspace

    1 tool error

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

    4 calls · #0215–#0218

    grep -n <val> -A <n> <path>Search <pattern> <path>grep -r -n <val> <path>headsed -n <val> <path>
  102. Inspect · Parallelism & communication

    Requested file and log inspection related to parallelism & communication.

    1 call · #0219–#0219

    Read <path>
  103. Inspect · Attention kernels

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

    1 call · #0220–#0220

    grep -n <val> -A <n> <path>head -n <n>
  104. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0221–#0221

    Read <path>
  105. Inspect · Attention kernels

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

    5 calls · #0222–#0226

    grep -r -n <val> <path>head -n <n>echo <flag>headRead <path>grep -n <val> <path>
  106. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0227–#0227

    Read <path>
  107. Edit · Source & workspace

    Requested code edits related to source & workspace.

    8 calls · #0228–#0235

    Edit <path>
  108. Inspect · Attention kernels

    Requested file and log inspection related to attention kernels.

    1 call · #0236–#0236

    Read <path>
  109. Inspect · Source & workspace

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

    3 calls · #0237–#0239

    grep -r -n <val> <path> <path> <path> <n> > <path>head -n <n>grep -r -n <val> <path> <path> <n> > <path>headecho <flag>grep -r -n <val> <path>
  110. Edit · Attention kernels

    Requested code edits related to attention kernels.

    2 calls · #0240–#0241

    Edit <path>
  111. Inspect · Source & workspace

    Requested task coordination related to source & workspace.

    1 call · #0242–#0242

    Update task list <tasks>
  112. Edit · Attention kernels

    Requested code edits related to attention kernels.

    2 calls · #0243–#0244

    Edit <path>
  113. Edit · Parallelism & communication

    Requested code edits related to parallelism & communication.

    2 calls · #0245–#0246

    Edit <path>
  114. Inspect · Benchmark & validation setup

    1 tool error

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

    2 calls · #0247–#0248

    python3 -c <script> <n> > <path>head -n <n>bash <script> > <path> <n> >& <path>python3 -c <script>ls <val> <n> > <path>
  115. Edit · Source & workspace

    Requested code edits related to source & workspace.

    2 calls · #0249–#0250

    Write <path>
  116. Other · Benchmark & validation setup

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

    1 call · #0251–#0251

    chmod <val> <path>python3 <script> <val> <script> <val> <n> > <path> <n> >& <path>echo <val>
  117. Inspect · Runtime processes

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

    1 call · #0252–#0252

    grep -n <val> -A <n> <path>head -n <n>grep -r -n <val> <path> <path> <n> > <path>head
  118. Inspect · Source & workspace

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

    1 call · #0253–#0253

    grep -r -n <val> <path> <n> > <path>head -n <n>headfind <path> -name <val>grep -n <val> <path>
  119. Inspect · Runtime processes

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

    1 call · #0254–#0254

    grep -n <val> <path>headecho <flag>grep -r -n <val> <path> <n> > <path>head -n <n>grep -r -n <val> <path> <path> -r
  120. Other · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0255–#0255

    Read task output <task>
  121. Inspect · Source & workspace

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

    2 calls · #0256–#0257

    tail -n <n> <path> <n> > <path>cut <flag>echo <path>grep -c <val> <path> <n> > <path>grep <val> <path>sleep <n>
    1 more command sketches
    tail -n <n> <path>
  122. Validate · Benchmark & validation setup

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

    1 call · #0258–#0258

    grep -o <val> <path>grep -o <val> <path> <n> > <path>ls <val>head -n <n>
  123. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0259–#0259

    Read <path>
  124. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0260–#0260

    Edit <path>
  125. Other · Benchmark & validation setup

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

    1 call · #0261–#0261

    python3 <script> <val> <script> <val> <n> > <path> <n> >& <path>echo <val>grep -E <val> <path>cut <flag>
  126. Inspect · Parallelism & communication

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

    1 call · #0262–#0262

    grep -n <val> <path>head -n <n>echo <flag>
  127. Inspect · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0263–#0263

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

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

    2 calls · #0264–#0265

    grep -n <val> <path>headgrep -r -n <val> <path> <n> > <path>head -n <n>sed -n <val> <path>grep -n <val> -A <n> <path>
  129. Other · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0266–#0266

    Read task output <task>
  130. Inspect · Source & workspace

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

    6 calls · #0267–#0272

    grep -n <val> -A <n> <path>head -n <n>cat <path>grep -n <val>grep -r -n <val> <path>grep -n <val> <path>
    3 more command sketches
    sed -n <val>grep -r -n <val> -A <n> <path>head
  131. Edit · Source & workspace

    Requested code edits related to source & workspace.

    1 call · #0273–#0273

    Edit <path>
  132. Inspect · Benchmark & validation setup

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

    1 call · #0274–#0274

    python3 <script> <val> <script> <val> <n> > <path> <n> >& <path>echo <val>echo <flag>tail -n <n> <path>cut <flag>sleep <n>
    4 more command sketches
    ps <val>grep -E <val>grep -v <val>head
  133. Inspect · Source & workspace

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

    1 call · #0275–#0275

    grep -n <val> -A <n> <path>head -n <n>
  134. Other · Source & workspace

    Requested file and log inspection related to source & workspace.

    1 call · #0276–#0276

    Read task output <task>
  135. Inspect · Source & workspace

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

    2 calls · #0277–#0278

    sleep <n>tail -n <n> <path> <n> > <path>cut <flag>cat <path>ps <val>grep -E <val>
    2 more command sketches
    grep -v <val>wc -l
  136. Validate · Benchmark & validation setup

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

    1 call · #0279–#0279

    bash <script> > <path> <n> >& <path>echo <val>
  137. Inspect · Parallelism & communication

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

    1 call · #0280–#0280

    grep -r -n <val> <path>head -n <n>grep -n <val> <path>grep -i <val>grep -r -n <val> -A <n> <path>
  138. Validate · Benchmark & validation setup

    Requested execution waits, workspace inspection and source searches related to benchmark & validation setup.

    1 call · #0281–#0281

    sleep <n>ls <val>grep <val>tail -n <n> <path> <n> > <path>cut <flag>
  139. Inspect · Source & workspace

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

    1 call · #0282–#0282

    grep -r -n <val> <path> <path> <path> --include <path>grep -v <val>head
  140. Validate · Benchmark & validation setup

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

    1 call · #0283–#0283

    ls <val>grep <val>tail -n <n> <path> <n> > <path>cut <flag>grep -c <val> <path> <n> > <path>
  141. Inspect · Source & workspace

    Requested task coordination related to source & workspace.

    1 call · #0284–#0284

    Update task list <tasks>
  142. Validate · Benchmark & validation setup

    1 tool error

    Requested execution waits, workspace inspection and source searches related to benchmark & validation setup.

    1 call · #0285–#0285

    sleep <n>ls <val>grep <val><command> <args>python3 -m <module> <path>head -n <n>
  143. Inspect · Benchmark & validation setup

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

    1 call · #0286–#0286

    tail -n <n> <path>cut <flag>ps <val>grep -c <val>
  144. Validate · Benchmark & validation setup

    Requested execution waits, script or workload execution and runtime inspection related to benchmark & validation setup.

    2 calls · #0287–#0288

    sleep <n><command> <args>python3 -c <script>cut <flag>ps <val>grep -c <val>
    1 more command sketches
    tail -n <n> <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 · 2 changed files

Base commit: df2ea7fad8e43016b0e2edbf7ce16026496df2ae

diff --git a/mindspeed/core/transformer/flash_attention/reset_attention_mask/adaptor.py b/mindspeed/core/transformer/flash_attention/reset_attention_mask/adaptor.pyindex cf83901088842333b53425ad794c7da0c3b75ea7..e8a1c6fb696e5f47480d4c6d0c246c0019fcf81a 100644--- a/mindspeed/core/transformer/flash_attention/reset_attention_mask/adaptor.py+++ b/mindspeed/core/transformer/flash_attention/reset_attention_mask/adaptor.py@@ -736,6 +736,16 @@ def rotary_forward(self, max_seq_len: int, offset: int = 0, packed_seq: bool = F     if self.inv_freq.device.type == 'cpu':         # move `inv_freq` to GPU once at the first micro-batch forward pass         self.inv_freq = self.inv_freq.to(device=torch.cuda.current_device())+    # The embedding depends only on (max_seq_len, offset, packed_seq) and the+    # module's fixed inv_freq; cache it so repeated micro-batches and layers do+    # not recompute identical values (bit-identical reuse).+    cache_key = (max_seq_len, offset, packed_seq)+    cache = getattr(self, "_mindspeed_rotary_emb_cache", None)+    if cache is None:+        cache = {}+        self._mindspeed_rotary_emb_cache = cache+    elif cache_key in cache:+        return cache[cache_key]     seq = (             torch.arange(max_seq_len, device=self.inv_freq.device, dtype=self.inv_freq.dtype)             + offset@@ -756,4 +766,5 @@ def rotary_forward(self, max_seq_len: int, offset: int = 0, packed_seq: bool = F     # emb [seq_length, .., dim]     emb = emb[:, None, None, :] +    cache[cache_key] = emb     return embdiff --git a/mindspeed/utils.py b/mindspeed/utils.pyindex af11f253d2d0aac4a1747fc34b4ab501e2727905..875c2ba77e1ee907c386ab424715279f866591d5 100644--- a/mindspeed/utils.py+++ b/mindspeed/utils.py@@ -368,13 +368,19 @@ def _broadcast(item):   def broadcast_dynamic(item):+    # Broadcasts over a single-rank tensor-parallel group are identity+    # operations; skip them to avoid two HCCL calls per micro-batch.+    skip_broadcast = mpu.get_tensor_model_parallel_world_size() == 1     if item is not None:         item = item.npu()         item_len = torch.tensor(item.numel(), device=torch.cuda.current_device())-        _broadcast(item_len)-        _broadcast(item)+        if not skip_broadcast:+            _broadcast(item_len)+            _broadcast(item)     else:         item_len = torch.empty((), dtype=torch.int64, device=torch.cuda.current_device())+        if skip_broadcast:+            raise RuntimeError("broadcast_dynamic expects a source item on a single-rank group")         _broadcast(item_len)         item = torch.empty([item_len.item()], dtype=torch.int64, device=torch.cuda.current_device())         _broadcast(item)
mindspeed_llm · 5 changed files

Base commit: 72c49a6260c73669678b8f39b1ba41a4789bb555

diff --git a/megatron/core/tensor_parallel/cross_entropy.py b/megatron/core/tensor_parallel/cross_entropy.pyindex 27c8f06344062d657d7c272f8468ae8ecda7bdfa..5e7d4ec5abfc7e367f76559513e8daf7487349ca 100644--- a/megatron/core/tensor_parallel/cross_entropy.py+++ b/megatron/core/tensor_parallel/cross_entropy.py@@ -127,15 +127,15 @@ class _VocabParallelCrossEntropy(torch.autograd.Function):         vocab_parallel_logits, logits_max = VocabParallelCrossEntropy.calculate_logits_max(             vocab_parallel_logits         )-        torch.distributed.all_reduce(-            logits_max, op=torch.distributed.ReduceOp.MAX, group=get_tensor_model_parallel_group()-        )-         # Get the partition's vocab indices         get_vocab_range = VocabUtility.vocab_range_from_per_partition_vocab_size         partition_vocab_size = vocab_parallel_logits.size()[-1]         rank = get_tensor_model_parallel_rank()         world_size = get_tensor_model_parallel_world_size()+        if world_size > 1:+            torch.distributed.all_reduce(+                logits_max, op=torch.distributed.ReduceOp.MAX, group=get_tensor_model_parallel_group()+            )         vocab_start_index, vocab_end_index = get_vocab_range(partition_vocab_size, rank, world_size)          (target_mask, masked_target_1d, predicted_logits, sum_exp_logits, exp_logits) = (@@ -145,17 +145,18 @@ class _VocabParallelCrossEntropy(torch.autograd.Function):         )          # All reduce is needed to get the chunks from other GPUs.-        torch.distributed.all_reduce(-            predicted_logits,-            op=torch.distributed.ReduceOp.SUM,-            group=get_tensor_model_parallel_group(),-        )+        if world_size > 1:+            torch.distributed.all_reduce(+                predicted_logits,+                op=torch.distributed.ReduceOp.SUM,+                group=get_tensor_model_parallel_group(),+            ) -        torch.distributed.all_reduce(-            sum_exp_logits,-            op=torch.distributed.ReduceOp.SUM,-            group=get_tensor_model_parallel_group(),-        )+            torch.distributed.all_reduce(+                sum_exp_logits,+                op=torch.distributed.ReduceOp.SUM,+                group=get_tensor_model_parallel_group(),+            )          exp_logits, loss = VocabParallelCrossEntropy.calculate_cross_entropy_loss(             exp_logits, predicted_logits, sum_exp_logitsdiff --git a/mindspeed_llm/core/models/common/embeddings/rotary_pos_embedding.py b/mindspeed_llm/core/models/common/embeddings/rotary_pos_embedding.pyindex bd2b975cb13f4d801c4b7668fb4c4e0e22d3b015..bec28c42ca06230e8f91116d9b4890e9f6af2916 100644--- a/mindspeed_llm/core/models/common/embeddings/rotary_pos_embedding.py+++ b/mindspeed_llm/core/models/common/embeddings/rotary_pos_embedding.py@@ -255,15 +255,34 @@ 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 depend only on freqs, the scale and the target dtype. Cache them+    # on the freqs tensor object so that all attention layers sharing the same+    # freqs within a micro-batch reuse a single computation (bit-identical).+    cache_key = (t.dtype, _mscale)+    cos_sin_cache = getattr(freqs, "_mindspeed_cos_sin_cache", None)+    if cos_sin_cache is not None and cache_key in cos_sin_cache:+        cos_, sin_ = cos_sin_cache[cache_key]+    else:+        cos_ = (torch.cos(freqs) * _mscale).to(t.dtype)+        sin_ = (torch.sin(freqs) * _mscale).to(t.dtype)+        if cos_sin_cache is None:+            cos_sin_cache = {}+            try:+                freqs._mindspeed_cos_sin_cache = cos_sin_cache+            except (AttributeError, RuntimeError):+                cos_sin_cache = None+        if cos_sin_cache is not None:+            cos_sin_cache[cache_key] = (cos_, sin_)+     if args.use_fused_rotary_pos_emb:         mode = 1 if rotary_interleaved else 0         t = npu_rotary_position_embedding(t.contiguous(), cos_, sin_, mode).to(t.dtype)     else:         t = (t * cos_) + (_rotate_half(t, rotary_interleaved) * sin_)-    ++    if t_pass.numel() == 0:+        # Concatenating an empty trailing slice only copies t; return it as-is.+        return t     return torch.cat((t, t_pass), dim=-1)  @@ -286,13 +305,26 @@ def apply_rotary_pos_emb_thd(      if args.reset_position_ids:         position_ids = cu_seqlens.position_ids-        block_size, bsz = position_ids.shape-        freqs = freqs[position_ids.view(-1)].reshape(block_size, bsz, 1, -1)+        # The gather depends only on (freqs, position_ids); both are constant+        # across attention layers within a micro-batch, so cache the result on+        # the packed-seq-params carrier (bit-identical reuse).+        gathered = getattr(cu_seqlens, "_mindspeed_gathered_freqs", None)+        if gathered is not None and gathered[0] is freqs:+            freqs = gathered[1]+        else:+            block_size, bsz = position_ids.shape+            gathered_freqs = freqs[position_ids.view(-1)].reshape(block_size, bsz, 1, -1)+            try:+                cu_seqlens._mindspeed_gathered_freqs = (freqs, gathered_freqs)+            except (AttributeError, RuntimeError):+                pass+            freqs = gathered_freqs     else:         # 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]+        if cp_size > 1:+            cp_rank = parallel_state.get_context_parallel_rank()+            freqs = freqs.chunk(cp_size, dim=0)[cp_rank]      return apply_rotary_pos_emb_bshd(t, freqs, rotary_interleaved, multi_latent_attention, mscale) diff --git a/mindspeed_llm/core/models/gpt/gpt_model.py b/mindspeed_llm/core/models/gpt/gpt_model.pyindex d83a185bd2a080924bc0422fe0621e708e17b75a..4f7ef72c593240084c85239d7cffe119cdaedc71 100644--- a/mindspeed_llm/core/models/gpt/gpt_model.py+++ b/mindspeed_llm/core/models/gpt/gpt_model.py@@ -29,6 +29,7 @@ from mindspeed_llm.core.tensor_parallel.layers import SegmentedColumnParallelLin from mindspeed_llm.training.utils import (set_actual_seq_len_list, _CAN_RECORD_REGISTRY,                             check_model_inputs) from mindspeed_llm.training.utils import set_actual_seq_len_list+from mindspeed_llm.training.utils import get_actual_seq_len_host from mindspeed.core.context_parallel.get_batch_utils import get_actual_seq_len from mindspeed.core.transformer.flash_attention.reset_attention_mask.adaptor import compute_qkv_index, get_position_ids from mindspeed_llm.core.models.common.chunk_loss import chunk_loss, calculate_lm_loss@@ -344,16 +345,24 @@ def gpt_forward_wrapper(fn):     @wraps(fn)     def wrapper(*args, **kwargs):         _args = get_args()-        actual_seq_len = get_actual_seq_len()-        actual_seq_len = recompute_valid_actual_seq_len(actual_seq_len, _args.micro_batch_size)+        actual_seq_len_host = get_actual_seq_len_host()+        if actual_seq_len_host is not None:+            # Host-side fast path: identical values, no device synchronization.+            actual_seq_len_list = recompute_valid_actual_seq_len(+                actual_seq_len_host, _args.micro_batch_size)+            cu_seqlens = list(actual_seq_len_list)+        else:+            actual_seq_len = get_actual_seq_len()+            actual_seq_len = recompute_valid_actual_seq_len(actual_seq_len, _args.micro_batch_size)+            actual_seq_len_list = actual_seq_len.tolist()+            cu_seqlens = actual_seq_len          packed_seq_params = PackedSeqParams(             qkv_format='thd',-            cu_seqlens_q=actual_seq_len,-            cu_seqlens_kv=actual_seq_len+            cu_seqlens_q=cu_seqlens,+            cu_seqlens_kv=cu_seqlens         ) -        actual_seq_len_list = actual_seq_len.tolist()         set_actual_seq_len_list(actual_seq_len_list)         if _args.mtp_num_layers:             actual_seq_len_list = actual_seq_len_list[0]diff --git a/mindspeed_llm/training/training.py b/mindspeed_llm/training/training.pyindex 66cfad6ad3511eda039cde69f087680f1315304e..6e53a8f15ed721ef8d16a31f7cca971136e55301 100644--- a/mindspeed_llm/training/training.py+++ b/mindspeed_llm/training/training.py@@ -529,6 +529,30 @@ def pretrain(train_valid_test_dataset_provider,     })     one_logger_utils.finish() +    # Fast, orderly shutdown. All training work, logging and checkpointing are+    # complete at this point. Stop dataloader workers, tear down the process+    # group, flush output, and exit immediately instead of paying for slow+    # interpreter finalization (device buffers are reclaimed by the OS/driver+    # when the process exits).+    import os as _os+    import sys as _sys+    import multiprocessing as _mp+    try:+        for _child in _mp.active_children():+            _child.terminate()+        for _child in _mp.active_children():+            _child.join(timeout=10)+    except Exception:+        pass+    try:+        if torch.distributed.is_available() and torch.distributed.is_initialized():+            torch.distributed.destroy_process_group()+    except Exception:+        pass+    _sys.stdout.flush()+    _sys.stderr.flush()+    _os._exit(0)+  def train(forward_step_func, model, optimizer, opt_param_scheduler,           train_data_iterator, valid_data_iterator,diff --git a/mindspeed_llm/training/utils.py b/mindspeed_llm/training/utils.pyindex c779adfcf9140eff6e1cae1ac28f45027763ff74..5b0cc3cb344151cf8f0fb3410a92105154d26b96 100644--- a/mindspeed_llm/training/utils.py+++ b/mindspeed_llm/training/utils.py@@ -123,6 +123,23 @@ def get_actual_attn_ratio():     return _ACTUAL_ATTN_RATIO_LIST, _ACTUAL_COUNT  +# Host-side copy of the packed-document cumulative sequence lengths.+# Keeping this on the host avoids a device-to-host synchronization in every+# micro-batch when building PackedSeqParams. It always mirrors the value+# passed to mindspeed.core.context_parallel.get_batch_utils.set_actual_seq_len.+_ACTUAL_SEQ_LEN_HOST = None+++def set_actual_seq_len_host(actual_seq_len):+    global _ACTUAL_SEQ_LEN_HOST+    _ACTUAL_SEQ_LEN_HOST = actual_seq_len+++def get_actual_seq_len_host():+    global _ACTUAL_SEQ_LEN_HOST+    return _ACTUAL_SEQ_LEN_HOST++ def set_mtp_batch_list(mtp_batch_list):     global _MTP_BATCH_LIST     _MTP_BATCH_LIST = mtp_batch_list@@ -166,6 +183,14 @@ def _compute_actual_seq_len(origin_seq): def recompute_valid_actual_seq_len(actual_seq_len, micro_batch_size):     if len(actual_seq_len) <= 1:         return actual_seq_len+    if not isinstance(actual_seq_len, torch.Tensor):+        # Pure host-side path: identical semantics without any device sync.+        diffs = [curr - prev for prev, curr in zip(actual_seq_len, actual_seq_len[1:])]+        indices = [i for i, diff in enumerate(diffs) if diff == 1]+        if len(indices) < micro_batch_size:+            return actual_seq_len+        first_continuous = indices[micro_batch_size - 1]+        return list(actual_seq_len[:first_continuous + 1]) + [actual_seq_len[-1]]     s = torch.tensor(actual_seq_len)     diffs = s[1:] - s[:-1]     indices = (diffs == 1).nonzero()@@ -495,8 +520,12 @@ def get_sharedmem_mgr(base_shm_name="g_shm", buffer_length=4096): def get_batch_on_this_tp_rank(data_iterator):     args = get_args() +    tp_world_size = mpu.get_tensor_model_parallel_world_size()+     def _broadcast(item):-        if item is not None:+        # With a single tensor-parallel rank the broadcast is an identity+        # operation; skipping it avoids one HCCL call per tensor per batch.+        if item is not None and tp_world_size > 1:             torch.distributed.broadcast(item, mpu.get_tensor_model_parallel_src_rank(),                                         group=mpu.get_tensor_model_parallel_group()) @@ -593,6 +622,12 @@ def get_batch_on_this_tp_rank(data_iterator):               and args.context_parallel_algo == 'megatron_cp_algo':                 actual_seq_len = pad_data(actual_seq_len, batch, args.context_parallel_size, args.tensor_model_parallel_size)                 actual_seq_len /= get_ring_degree()+                set_actual_seq_len_host(None)+            else:+                # data['actual_seq_len'] is already a host tensor here; keep a+                # host copy so the model forward does not need to sync the+                # device to recover these values.+                set_actual_seq_len_host(data['actual_seq_len'].tolist())             set_actual_seq_len(actual_seq_len)      else:@@ -676,6 +711,9 @@ def get_batch_on_this_tp_rank(data_iterator):                 actual_seq_len = pad_data(actual_seq_len, batch, args.context_parallel_size,                                           args.tensor_model_parallel_size)                 actual_seq_len /= get_ring_degree()+            # No host copy on non-source tensor-parallel ranks; the model+            # forward falls back to reading the device tensor.+            set_actual_seq_len_host(None)             set_actual_seq_len(actual_seq_len)     return batch