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>DeepSeek-V4-Pro · Training
Qwen3-4B CodeOpt TP2 training 2dev · Implementation Optimization
01 / PROCESS MAP
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
02 / EVENT SEQUENCE
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.
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>.
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>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>Requested file and log inspection related to checkpoints & weight state.
1 call · #0004–#0004
cd <val>echo <flag>cat <path>echoRequested file and log inspection related to source & workspace.
1 call · #0005–#0005
cd <val>wc -l <path> <path>sed -n <val> <path>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>head -c <n>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>sortechocat <path> <n> > <path>headbash <script> <n> >& <path>tail -n <n>bash <script>echo <val>ls -l -a <val>head -n <n>cat <val>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>echo <flag>cat <path> <n> > <path>ls -l -a <val>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>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>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>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>cat <path> <n> > <path>python3 -m <module>head -n <n>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>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>Requested file and log inspection related to dependencies & build setup.
1 call · #0027–#0027
cd <path>sed -n <val> <path>echo <flag>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>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>sed -n <val> <path>Requested environment setup or inspection related to attention kernels.
1 call · #0034–#0034
cd <path>env <vars> python3 - <script>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>tr <val> <val>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>Requested environment setup or inspection related to source & workspace.
1 call · #0038–#0038
cd <path>env <vars> python3 - <script>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>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>Requested environment setup or inspection related to attention kernels.
1 call · #0043–#0043
cd <path>env <vars> python3 - <script>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>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>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>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<command> <args>sed -n <val> <val>cat <path>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>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>tail -n <n> <val> <n> > <path>echo <val> <val>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>head -n <n>grep -n <val> -R <val> <val> <val> <n> > <path>sed -n <val> <path>grep -R <val> -n <path>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>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>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>grep -n <val> <path>ls -l <path>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>Requested file and log inspection related to source & workspace.
1 call · #0070–#0070
cd <val>sed -n <val> <val>Requested file and log inspection related to attention kernels.
2 calls · #0071–#0072
cd <path>sed -n <val> <path>echo <flag>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>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>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>grep -R <val> -n <path> <path>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>grep -n <val> -R <path> <path>cd <val><command> <args>echo <val>tail -n <n> <path>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>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>Requested file and log inspection related to parallelism & communication.
1 call · #0087–#0087
cd <path>sed -n <val> <path>Requested file and log inspection related to source & workspace.
4 calls · #0088–#0091
cd <val><command> <args>echo <val>tail -n <n> <path>Requested file and log inspection related to batching & scheduling.
8 calls · #0092–#0099
cd <val><command> <args>echo <val>tail -n <n> <path>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>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>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>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>Requested file and log inspection related to parallelism & communication.
1 call · #0105–#0105
cd <path>sed -n <val> <path>Requested file and log inspection related to batching & scheduling.
2 calls · #0106–#0107
cd <val><command> <args>echo <val>tail -n <n> <path>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>Requested file and log inspection related to batching & scheduling.
1 call · #0109–#0109
cd <val><command> <args>echo <val>tail -n <n> <path>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>Requested file and log inspection related to batching & scheduling.
2 calls · #0112–#0113
cd <val><command> <args>echo <val>tail -n <n> <path>Requested script or workload execution related to source & workspace.
1 call · #0114–#0114
python3 - <script>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>Requested script or workload execution related to optimizer & gradients.
2 calls · #0116–#0117
python3 - <script>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>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>grep -n <val> -n <path>Requested file and log inspection related to batching & scheduling.
1 call · #0121–#0121
cd <val><command> <args>echo <val>tail -n <n> <path>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>Requested script or workload execution related to source & workspace.
1 call · #0124–#0124
python3 - <script>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>headgrep -n <val> -R <path> <path> <n> > <path>grep -n <val> -R <path> <n> > <path>grep -R <val> -n <path> <path> <n> > <path>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>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>cat <path> <n> > <path>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>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>Requested file and log inspection related to batching & scheduling.
1 call · #0134–#0134
cd <val><command> <args>echo <val>tail -n <n> <path>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>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>Requested file and log inspection related to batching & scheduling.
1 call · #0137–#0137
cd <val><command> <args>echo <val>tail -n <n> <path>Requested file and log inspection related to source & workspace.
1 call · #0138–#0138
cd <path>sed -n <val> <path>Requested file and log inspection related to batching & scheduling.
1 call · #0139–#0139
cd <val><command> <args>echo <val>tail -n <n> <path>Requested file and log inspection and script or workload execution related to source & workspace.
1 call · #0140–#0140
cat > <path> <script>python3 <script>Requested file and log inspection and script or workload execution related to attention kernels.
3 calls · #0141–#0143
cat > <path> <script>python3 <script>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>grep -n <val> <path>Requested script or workload execution and source searches related to source & workspace.
1 call · #0148–#0148
cd <path>python3 - <script>grep -n <val> <path>Requested file and log inspection related to batching & scheduling.
1 call · #0149–#0149
cd <val><command> <args>echo <val>tail -n <n> <path>Requested file and log inspection related to optimizer & gradients.
1 call · #0150–#0150
cd <val><command> <args>echo <val>tail -n <n> <path>Requested file and log inspection related to batching & scheduling.
1 call · #0151–#0151
cd <val><command> <args>echo <val>tail -n <n> <path>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>headRequested 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>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>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>sed -n <val>Requested file and log inspection related to batching & scheduling.
2 calls · #0159–#0160
cd <val><command> <args>echo <val>tail -n <n> <path>Requested repository inspection and file and log inspection related to source & workspace.
2 calls · #0161–#0162
cd <path>git status --shortsed -n <val> <path>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>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>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>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>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>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>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>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>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>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>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>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
Read code changes as Git diffs. Identifying strings are masked; binary files are listed by their full relative names.
Base commit: 72c49a6260c73669678b8f39b1ba41a4789bb555
@@ -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")