Inspect · Source & workspace
Requested workspace inspection related to source & workspace.
1 call · #0001–#0001
echo <val>ls -l -a <val>Gemini 3.7 Flash · Training
LFM2-1.2B model adapt training 1dev · Model Adaptation
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 agentGemini 3.7 Flash · 739 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 related to source & workspace.
1 call · #0001–#0001
echo <val>ls -l -a <val>Requested file and log inspection and workspace inspection related to task requirements.
3 calls · #0002–#0004
Read <path>ls -l -a <path> <path> <path> <path> <path> <path>Requested file and log inspection related to source & workspace.
2 calls · #0005–#0006
Read <path>Requested file and log inspection related to benchmark & validation setup.
1 call · #0007–#0007
Read <path>Requested file and log inspection related to source & workspace.
1 call · #0008–#0008
Read <path>Requested file and log inspection related to task requirements.
2 calls · #0009–#0010
Read <path>Requested file and log inspection and workspace inspection related to source & workspace.
8 calls · #0011–#0018
Read <path>ls -l -a <path> <path>Requested script or workload execution, environment setup or inspection and source searches related to source & workspace.
2 calls · #0019–#0020
bash <script>envgrep <val>Requested workspace inspection and file and log inspection related to source & workspace.
2 calls · #0021–#0022
ls -l -a <path>Read <path>Requested script or workload execution and task coordination related to source & workspace.
2 calls · #0023–#0024
python3 -c <script>Manage task <task>Requested file and log inspection related to source & workspace.
1 call · #0025–#0025
Read <path>Requested task coordination related to source & workspace.
1 call · #0026–#0026
Manage task <task>Requested workspace inspection related to checkpoints & weight state.
1 call · #0027–#0027
ls -l -a <path> <path> <path>Requested task coordination and script or workload execution related to source & workspace.
7 calls · #0028–#0034
Manage task <task>which <val>python3 -c <script>Requested file and log inspection related to source & workspace.
1 call · #0035–#0035
Read <path>Requested task coordination related to source & workspace.
1 call · #0036–#0036
Manage task <task>Requested workspace inspection and file and log inspection related to source & workspace.
2 calls · #0037–#0038
Find <pattern>Read <path>Requested task coordination, script or workload execution and environment setup or inspection related to source & workspace.
5 calls · #0039–#0043
Manage task <task>python3 -c <script>env <vars> python3 -c <script>Requested workspace inspection and file and log inspection related to source & workspace.
2 calls · #0044–#0045
ls -l -a <path>Read <path>Requested task coordination related to source & workspace.
1 call · #0046–#0046
Manage task <task>Requested runtime inspection related to device memory.
1 call · #0047–#0047
npu-smi infoRequested file and log inspection related to source & workspace.
1 call · #0048–#0048
Read <path>Requested script or workload execution related to source & workspace.
1 call · #0049–#0049
python3 -B <script> <val>Requested file and log inspection and source searches related to source & workspace.
7 calls · #0050–#0056
Read <path>Search <pattern> <path>Requested script or workload execution related to source & workspace.
1 call · #0057–#0057
python3 -c <script>Requested file and log inspection related to source & workspace.
4 calls · #0058–#0061
Read <path>Requested file and log inspection related to checkpoints & weight state.
7 calls · #0062–#0068
Read <path>Requested file and log inspection related to source & workspace.
3 calls · #0069–#0071
Read <path>Requested source searches related to checkpoints & weight state.
1 call · #0072–#0072
Search <pattern> <path>Requested file and log inspection related to source & workspace.
1 call · #0073–#0073
Read <path>Requested source searches related to convolution & sequence boundaries.
1 call · #0074–#0074
Search <pattern> <path>Requested source searches and file and log inspection related to source & workspace.
5 calls · #0075–#0079
Search <pattern> <path>Read <path>Requested file and log inspection related to attention kernels.
8 calls · #0080–#0087
Read <path>Requested file and log inspection, source searches and workspace inspection related to source & workspace.
10 calls · #0088–#0097
Read <path>Search <pattern> <path>Find <pattern>Requested file and log inspection related to checkpoints & weight state.
1 call · #0098–#0098
Read <path>Requested file and log inspection related to source & workspace.
2 calls · #0099–#0100
Read <path>Requested source searches and file and log inspection related to checkpoints & weight state.
2 calls · #0101–#0102
Search <pattern> <path>Read <path>Requested tool activity related to attention kernels.
1 call · #0103–#0103
shell <script>Requested file and log inspection related to source & workspace.
1 call · #0104–#0104
Read <path>Requested task coordination related to source & workspace.
1 call · #0105–#0105
Manage task <task>Requested file and log inspection related to source & workspace.
1 call · #0106–#0106
Read <path>Requested task coordination related to source & workspace.
1 call · #0107–#0107
Manage task <task>Requested file and log inspection related to source & workspace.
1 call · #0108–#0108
Read <path>Requested task coordination related to source & workspace.
1 call · #0109–#0109
Manage task <task>Requested tool activity related to attention kernels.
1 call · #0110–#0110
shell <script>Requested file and log inspection related to source & workspace.
1 call · #0111–#0111
Read <path>Requested task coordination related to source & workspace.
1 call · #0112–#0112
Manage task <task>Requested file and log inspection related to source & workspace.
2 calls · #0113–#0114
Read <path>Requested task coordination related to source & workspace.
1 call · #0115–#0115
Manage task <task>Requested file and log inspection related to source & workspace.
5 calls · #0116–#0120
Read <path>Requested task coordination related to source & workspace.
1 call · #0121–#0121
Manage task <task>Requested file and log inspection related to source & workspace.
2 calls · #0122–#0123
Read <path>Requested task coordination related to source & workspace.
1 call · #0124–#0124
Manage task <task>Requested file and log inspection related to source & workspace.
1 call · #0125–#0125
Read <path>Requested task coordination related to source & workspace.
1 call · #0126–#0126
Manage task <task>Requested code edits related to source & workspace.
1 call · #0127–#0127
Write <path>Requested script or workload execution related to convolution & sequence boundaries.
1 call · #0128–#0128
python3 -c <script>Requested tool activity related to runtime processes.
1 call · #0129–#0129
shell <script>Requested tool activity related to attention kernels.
2 calls · #0130–#0131
shell <script>Requested script or workload execution related to benchmark & validation setup.
1 call · #0132–#0132
bash <script>Requested file and log inspection related to checkpoints & weight state.
1 call · #0133–#0133
Read <path>Requested code edits related to checkpoints & weight state.
1 call · #0134–#0134
Edit <path>Requested script or workload execution related to benchmark & validation setup.
1 call · #0135–#0135
bash <script>Requested workspace file updates related to source & workspace.
1 call · #0136–#0136
rm -rf <path>Requested script or workload execution related to benchmark & validation setup.
1 call · #0137–#0137
bash <script>Requested workspace inspection related to source & workspace.
1 call · #0138–#0138
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0139–#0139
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0140–#0140
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0141–#0141
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0142–#0142
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0143–#0143
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0144–#0144
ls -l -a <path>Requested file and log inspection related to benchmark & validation setup.
1 call · #0145–#0145
Read <path>Requested workspace inspection related to source & workspace.
1 call · #0146–#0146
ls -l -a <path>Requested file and log inspection related to benchmark & validation setup.
1 call · #0147–#0147
Read <path>Requested task coordination related to source & workspace.
1 call · #0148–#0148
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0149–#0150
Read <path>Requested task coordination related to source & workspace.
1 call · #0151–#0151
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
3 calls · #0152–#0154
Read <path>Requested task coordination related to source & workspace.
1 call · #0155–#0155
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0156–#0157
Read <path>Requested task coordination related to source & workspace.
1 call · #0158–#0158
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
4 calls · #0159–#0162
Read <path>Requested task coordination related to source & workspace.
1 call · #0163–#0163
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
9 calls · #0164–#0172
Read <path>Requested task coordination related to source & workspace.
1 call · #0173–#0173
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0174–#0175
Read <path>Requested task coordination related to source & workspace.
1 call · #0176–#0176
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0177–#0178
Read <path>Requested task coordination related to source & workspace.
1 call · #0179–#0179
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0180–#0180
Read <path>Requested task coordination related to source & workspace.
1 call · #0181–#0181
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0182–#0182
Read <path>Requested task coordination related to source & workspace.
1 call · #0183–#0183
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0184–#0185
Read <path>Requested task coordination related to source & workspace.
1 call · #0186–#0186
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0187–#0187
Read <path>Requested task coordination related to source & workspace.
1 call · #0188–#0188
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0189–#0189
Read <path>Requested task coordination related to source & workspace.
1 call · #0190–#0190
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0191–#0191
Read <path>Requested task coordination related to source & workspace.
1 call · #0192–#0192
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0193–#0194
Read <path>Requested task coordination related to source & workspace.
1 call · #0195–#0195
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0196–#0196
Read <path>Requested task coordination related to source & workspace.
1 call · #0197–#0197
Manage task <task>Requested file and log inspection related to source & workspace.
1 call · #0198–#0198
Read <path>Requested task coordination and workspace file updates related to source & workspace.
2 calls · #0199–#0200
Manage task <task>rm -rf <path>Requested script or workload execution related to benchmark & validation setup.
1 call · #0201–#0201
bash <script>Requested workspace inspection related to source & workspace.
1 call · #0202–#0202
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0203–#0203
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0204–#0204
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0205–#0205
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0206–#0206
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0207–#0207
Manage task <task>Requested workspace inspection related to source & workspace.
2 calls · #0208–#0209
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0210–#0210
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0211–#0211
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0212–#0212
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0213–#0213
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0214–#0214
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0215–#0215
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0216–#0216
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0217–#0217
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0218–#0218
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0219–#0219
ls -l -a <path>Requested file and log inspection related to benchmark & validation setup.
1 call · #0220–#0220
Read <path>Requested workspace inspection related to source & workspace.
2 calls · #0221–#0222
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0223–#0223
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0224–#0224
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0225–#0225
Manage task <task>Requested workspace inspection related to source & workspace.
2 calls · #0226–#0227
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0228–#0228
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0229–#0229
ls -l -a <path>Requested file and log inspection related to benchmark & validation setup.
1 call · #0230–#0230
Read <path>Requested task coordination related to source & workspace.
1 call · #0231–#0231
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0232–#0233
Read <path>Requested task coordination related to source & workspace.
1 call · #0234–#0234
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0235–#0236
Read <path>Requested task coordination related to source & workspace.
1 call · #0237–#0237
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0238–#0239
Read <path>Requested task coordination related to source & workspace.
1 call · #0240–#0240
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0241–#0242
Read <path>Requested task coordination related to source & workspace.
1 call · #0243–#0243
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0244–#0245
Read <path>Requested task coordination related to source & workspace.
1 call · #0246–#0246
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0247–#0248
Read <path>Requested task coordination related to source & workspace.
1 call · #0249–#0249
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0250–#0251
Read <path>Requested task coordination related to source & workspace.
1 call · #0252–#0252
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0253–#0253
Read <path>Requested task coordination related to source & workspace.
1 call · #0254–#0254
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0255–#0256
Read <path>Requested task coordination related to source & workspace.
1 call · #0257–#0257
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0258–#0258
Read <path>Requested task coordination related to source & workspace.
1 call · #0259–#0259
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
3 calls · #0260–#0262
Read <path>Requested task coordination related to source & workspace.
1 call · #0263–#0263
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0264–#0264
Read <path>Requested task coordination related to source & workspace.
1 call · #0265–#0265
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0266–#0266
Read <path>Requested task coordination related to source & workspace.
1 call · #0267–#0267
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
3 calls · #0268–#0270
Read <path>Requested task coordination related to source & workspace.
1 call · #0271–#0271
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0272–#0272
Read <path>Requested task coordination related to source & workspace.
1 call · #0273–#0273
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0274–#0274
Read <path>Requested task coordination related to source & workspace.
1 call · #0275–#0275
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0276–#0276
Read <path>Requested task coordination related to source & workspace.
1 call · #0277–#0277
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0278–#0278
Read <path>Requested task coordination related to source & workspace.
1 call · #0279–#0279
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0280–#0281
Read <path>Requested task coordination related to source & workspace.
1 call · #0282–#0282
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
4 calls · #0283–#0286
Read <path>Requested task coordination related to source & workspace.
1 call · #0287–#0287
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0288–#0289
Read <path>Requested task coordination related to source & workspace.
1 call · #0290–#0290
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0291–#0292
Read <path>Requested task coordination related to source & workspace.
1 call · #0293–#0293
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0294–#0294
Read <path>Requested task coordination related to source & workspace.
1 call · #0295–#0295
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0296–#0296
Read <path>Requested task coordination related to source & workspace.
1 call · #0297–#0297
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0298–#0298
ls -l -a <path>Requested file and log inspection related to benchmark & validation setup.
1 call · #0299–#0299
Read <path>Requested workspace inspection related to source & workspace.
1 call · #0300–#0300
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0301–#0301
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0302–#0302
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0303–#0303
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0304–#0304
ls -l -a <path>Requested file and log inspection related to benchmark & validation setup.
1 call · #0305–#0305
Read <path>Requested task coordination related to source & workspace.
1 call · #0306–#0306
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0307–#0307
Read <path>Requested task coordination related to source & workspace.
1 call · #0308–#0308
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0309–#0310
Read <path>Requested task coordination related to source & workspace.
1 call · #0311–#0311
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0312–#0313
Read <path>Requested task coordination related to source & workspace.
1 call · #0314–#0314
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0315–#0316
Read <path>Requested task coordination related to source & workspace.
1 call · #0317–#0317
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0318–#0319
Read <path>Requested task coordination related to source & workspace.
1 call · #0320–#0320
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0321–#0322
Read <path>Requested task coordination related to source & workspace.
1 call · #0323–#0323
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0324–#0325
Read <path>Requested task coordination related to source & workspace.
1 call · #0326–#0326
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0327–#0328
Read <path>Requested task coordination related to source & workspace.
1 call · #0329–#0329
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0330–#0330
Read <path>Requested task coordination related to source & workspace.
1 call · #0331–#0331
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0332–#0333
Read <path>Requested task coordination related to source & workspace.
4 calls · #0334–#0337
Manage task <task>Requested file and log inspection related to source & workspace.
1 call · #0338–#0338
Read <path>Requested task coordination and workspace file updates related to source & workspace.
3 calls · #0339–#0341
Manage task <task>rm -rf <path>Requested script or workload execution related to benchmark & validation setup.
1 call · #0342–#0342
bash <script>Requested workspace inspection related to source & workspace.
1 call · #0343–#0343
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0344–#0344
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0345–#0345
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0346–#0346
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0347–#0347
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0348–#0348
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0349–#0349
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0350–#0350
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0351–#0351
Read <path>Requested task coordination related to source & workspace.
1 call · #0352–#0352
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0353–#0353
Read <path>Requested task coordination related to source & workspace.
1 call · #0354–#0354
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0355–#0355
Read <path>Requested task coordination related to source & workspace.
1 call · #0356–#0356
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0357–#0357
Read <path>Requested task coordination related to source & workspace.
1 call · #0358–#0358
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0359–#0359
Read <path>Requested task coordination related to source & workspace.
1 call · #0360–#0360
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0361–#0361
Read <path>Requested task coordination related to source & workspace.
1 call · #0362–#0362
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0363–#0363
Read <path>Requested task coordination related to source & workspace.
1 call · #0364–#0364
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0365–#0365
Read <path>Requested task coordination related to source & workspace.
1 call · #0366–#0366
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0367–#0367
Read <path>Requested task coordination related to source & workspace.
1 call · #0368–#0368
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0369–#0369
Read <path>Requested task coordination related to source & workspace.
1 call · #0370–#0370
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0371–#0371
Read <path>Requested task coordination related to source & workspace.
1 call · #0372–#0372
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0373–#0373
Read <path>Requested task coordination related to source & workspace.
1 call · #0374–#0374
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0375–#0375
Read <path>Requested task coordination related to source & workspace.
1 call · #0376–#0376
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0377–#0377
Read <path>Requested task coordination related to source & workspace.
1 call · #0378–#0378
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0379–#0380
Read <path>Requested task coordination related to source & workspace.
1 call · #0381–#0381
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0382–#0382
Read <path>Requested task coordination related to source & workspace.
1 call · #0383–#0383
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0384–#0384
Read <path>Requested task coordination related to source & workspace.
1 call · #0385–#0385
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0386–#0386
Read <path>Requested task coordination related to source & workspace.
1 call · #0387–#0387
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0388–#0388
Read <path>Requested task coordination related to source & workspace.
1 call · #0389–#0389
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0390–#0390
Read <path>Requested task coordination related to source & workspace.
1 call · #0391–#0391
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0392–#0392
Read <path>Requested task coordination related to source & workspace.
1 call · #0393–#0393
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0394–#0394
Read <path>Requested task coordination related to source & workspace.
1 call · #0395–#0395
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0396–#0396
Read <path>Requested workspace inspection related to source & workspace.
2 calls · #0397–#0398
ls -l -a <path>Requested task coordination related to source & workspace.
1 call · #0399–#0399
Manage task <task>Requested workspace inspection related to source & workspace.
1 call · #0400–#0400
ls -l -a <path>Requested file and log inspection related to benchmark & validation setup.
1 call · #0401–#0401
Read <path>Requested task coordination related to source & workspace.
1 call · #0402–#0402
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0403–#0403
Read <path>Requested task coordination related to source & workspace.
1 call · #0404–#0404
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0405–#0405
Read <path>Requested task coordination related to source & workspace.
1 call · #0406–#0406
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0407–#0407
Read <path>Requested task coordination related to source & workspace.
1 call · #0408–#0408
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0409–#0409
Read <path>Requested task coordination related to source & workspace.
1 call · #0410–#0410
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0411–#0411
Read <path>Requested task coordination related to source & workspace.
1 call · #0412–#0412
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0413–#0413
Read <path>Requested task coordination related to source & workspace.
1 call · #0414–#0414
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0415–#0415
Read <path>Requested task coordination related to source & workspace.
1 call · #0416–#0416
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0417–#0418
Read <path>Requested task coordination related to source & workspace.
1 call · #0419–#0419
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0420–#0420
Read <path>Requested task coordination related to source & workspace.
1 call · #0421–#0421
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0422–#0422
Read <path>Requested task coordination related to source & workspace.
1 call · #0423–#0423
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
2 calls · #0424–#0425
Read <path>Requested task coordination related to source & workspace.
1 call · #0426–#0426
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0427–#0427
Read <path>Requested task coordination related to source & workspace.
1 call · #0428–#0428
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0429–#0429
Read <path>Requested task coordination related to source & workspace.
1 call · #0430–#0430
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0431–#0431
Read <path>Requested task coordination related to source & workspace.
1 call · #0432–#0432
Manage task <task>Requested file and log inspection related to benchmark & validation setup.
1 call · #0433–#0433
Read <path>Requested task coordination related to source & workspace.
4 calls · #0434–#0437
Manage task <task>Requested file and log inspection related to attention kernels.
2 calls · #0438–#0439
Read <path>Requested script or workload execution related to source & workspace.
1 call · #0440–#0440
bash <script>Requested workspace file updates and script or workload execution related to benchmark & validation setup.
1 call · #0441–#0441
rm -rf <path>bash <script>Requested task coordination related to source & workspace.
2 calls · #0442–#0443
Manage task <task>Requested file and log inspection related to source & workspace.
1 call · #0444–#0444
Read <path>Requested task coordination related to source & workspace.
4 calls · #0445–#0448
Manage task <task>Requested file and log inspection related to source & workspace.
1 call · #0449–#0449
Read <path>Requested task coordination related to source & workspace.
4 calls · #0450–#0453
Manage task <task>Requested file and log inspection related to source & workspace.
1 call · #0454–#0454
Read <path>Requested task coordination related to source & workspace.
43 calls · #0455–#0497
Manage task <task>Requested workspace file updates and script or workload execution related to benchmark & validation setup.
1 call · #0498–#0498
rm -rf <path>bash <script>Requested task coordination related to source & workspace.
133 calls · #0499–#0631
Manage task <task>Requested workspace file updates and script or workload execution related to benchmark & validation setup.
1 call · #0632–#0632
rm -rf <path>bash <script>Requested task coordination related to source & workspace.
101 calls · #0633–#0733
Manage task <task>Requested repository inspection and workspace inspection related to source & workspace.
3 calls · #0734–#0736
git statusls -l -a <path>Requested workspace file updates related to checkpoints & weight state.
1 call · #0737–#0737
chmod -R <n> <path> <path> <path>Requested workspace inspection related to source & workspace.
1 call · #0738–#0738
ls -l -a <path>Requested runtime inspection related to device memory.
1 call · #0739–#0739
npu-smi info03 / CANDIDATE ARTIFACT
Read code changes as Git diffs. Identifying strings are masked; binary files are listed by their full relative names.
Base commit: 72c49a6260c73669678b8f39b1ba41a4789bb555
@@ -0,0 +1,3 @@+from .short_conv import ShortConv, ShortConvSubmodules++__all__ = ["ShortConv", "ShortConvSubmodules"]@@ -0,0 +1,88 @@+# Copyright (c) 2025, HUAWEI CORPORATION. All rights reserved.+from dataclasses import dataclass+from typing import Union++import torch+import torch.nn as nn+from megatron.core.transformer.module import MegatronModule+from megatron.core.transformer.spec_utils import ModuleSpec, build_module+from megatron.core.transformer.transformer_config import TransformerConfig+++@dataclass+class ShortConvSubmodules:+ in_proj: Union[ModuleSpec, type] = None+ out_proj: Union[ModuleSpec, type] = None+++class ShortConv(MegatronModule):+ """+ LFM2 Short Convolution layer for hybrid MCore models.+ """++ def __init__(+ self,+ config: TransformerConfig,+ submodules: ShortConvSubmodules,+ layer_number: int = 1,+ conv_kernel: int = 3,+ **kwargs,+ ):+ super().__init__(config=config)+ self.config = config+ self.layer_number = layer_number+ self.conv_kernel = getattr(config, "conv_kernel", conv_kernel)+ hidden_size = config.hidden_size++ self.in_proj = build_module(+ submodules.in_proj,+ hidden_size,+ 3 * hidden_size,+ config=self.config,+ init_method=self.config.init_method,+ gather_output=False,+ bias=self.config.add_bias_linear,+ skip_bias_add=False,+ is_expert=False,+ )++ self.conv = nn.Conv1d(+ in_channels=hidden_size,+ out_channels=hidden_size,+ kernel_size=self.conv_kernel,+ groups=hidden_size,+ bias=False,+ padding=self.conv_kernel - 1,+ )++ self.out_proj = build_module(+ submodules.out_proj,+ hidden_size,+ hidden_size,+ config=self.config,+ init_method=self.config.output_layer_init_method,+ bias=self.config.add_bias_linear,+ input_is_parallel=True,+ skip_bias_add=True,+ is_expert=False,+ )++ def forward(+ self,+ hidden_states: torch.Tensor,+ *args,+ **kwargs,+ ):+ seq_len, batch_size, hidden_size = hidden_states.shape++ projected, _ = self.in_proj(hidden_states)+ B, C, x = torch.chunk(projected, 3, dim=-1)+ Bx = B * x++ Bx_conv = Bx.permute(1, 2, 0).contiguous()+ conv_out = self.conv(Bx_conv)[..., :seq_len]+ conv_out = conv_out.permute(2, 0, 1).contiguous()++ y = C * conv_out+ out, bias = self.out_proj(y)+ return out, bias@@ -0,0 +1,310 @@+# Copyright (c) 2025, HUAWEI CORPORATION. All rights reserved.+import argparse+import json+import os+import shutil+from pathlib import Path+from typing import Dict++import torch+from safetensors import safe_open+from safetensors.torch import save_file+++DEFAULT_LAYER_TYPES = [+ "conv", "conv", "full_attention", "conv",+ "conv", "full_attention", "conv", "conv",+ "full_attention", "conv", "full_attention", "conv",+ "full_attention", "conv", "full_attention", "conv",+]+++def hf_to_mcore(load_dir: str, save_dir: str):+ load_path = Path(load_dir)+ save_path = Path(save_dir)++ config_path = load_path / "config.json"+ if config_path.exists():+ with open(config_path, "r", encoding="utf-8") as f:+ config = json.load(f)+ else:+ config = {}++ layer_types = config.get("layer_types", DEFAULT_LAYER_TYPES)+ hidden_size = config.get("hidden_size", 2048)+ num_heads = config.get("num_attention_heads", 32)+ num_kv_heads = config.get("num_key_value_heads", 8)+ head_dim = hidden_size // num_heads+ num_groups = num_kv_heads+ heads_per_group = num_heads // num_groups+ q_group_dim = heads_per_group * head_dim+ kv_group_dim = head_dim+ total_group_dim = q_group_dim + 2 * kv_group_dim+ ffn_size = 8192++ hf_weights: Dict[str, torch.Tensor] = {}+ safetensors_path = load_path / "model.safetensors"+ if safetensors_path.exists():+ with safe_open(safetensors_path, framework="pt", device="cpu") as f:+ for k in f.keys():+ hf_weights[k] = f.get_tensor(k)+ else:+ for fpath in sorted(load_path.glob("*.safetensors")):+ with safe_open(fpath, framework="pt", device="cpu") as f:+ for k in f.keys():+ hf_weights[k] = f.get_tensor(k)++ mcore_weights: Dict[str, torch.Tensor] = {}+ if "model.embed_tokens.weight" in hf_weights:+ mcore_weights["embedding.word_embeddings.weight"] = hf_weights["model.embed_tokens.weight"].clone()+ if "model.embedding_norm.weight" in hf_weights:+ mcore_weights["decoder.final_layernorm.weight"] = hf_weights["model.embedding_norm.weight"].clone()++ for idx, ltype in enumerate(layer_types):+ op_norm_key = f"model.layers.{idx}.operator_norm.weight"+ if op_norm_key in hf_weights:+ mcore_weights[f"decoder.layers.{idx}.input_layernorm.weight"] = hf_weights[op_norm_key].clone()++ ffn_norm_key = f"model.layers.{idx}.ffn_norm.weight"+ if ffn_norm_key in hf_weights:+ mcore_weights[f"decoder.layers.{idx}.pre_mlp_layernorm.weight"] = hf_weights[ffn_norm_key].clone()++ w1_key = f"model.layers.{idx}.feed_forward.w1.weight"+ w3_key = f"model.layers.{idx}.feed_forward.w3.weight"+ w2_key = f"model.layers.{idx}.feed_forward.w2.weight"+ if w1_key in hf_weights and w3_key in hf_weights:+ w1 = hf_weights[w1_key]+ w3 = hf_weights[w3_key]+ mcore_weights[f"decoder.layers.{idx}.mlp.linear_fc1.weight"] = torch.cat([w1, w3], dim=0).clone()+ if w2_key in hf_weights:+ mcore_weights[f"decoder.layers.{idx}.mlp.linear_fc2.weight"] = hf_weights[w2_key].clone()++ if ltype == "full_attention":+ q_key = f"model.layers.{idx}.self_attn.q_proj.weight"+ k_key = f"model.layers.{idx}.self_attn.k_proj.weight"+ v_key = f"model.layers.{idx}.self_attn.v_proj.weight"+ if q_key in hf_weights and k_key in hf_weights and v_key in hf_weights:+ q = hf_weights[q_key]+ k = hf_weights[k_key]+ v = hf_weights[v_key]+ qkv = torch.empty((num_groups * total_group_dim, hidden_size), dtype=q.dtype)+ for g in range(num_groups):+ qkv[g * total_group_dim : g * total_group_dim + q_group_dim] = q[g * q_group_dim : (g + 1) * q_group_dim]+ qkv[g * total_group_dim + q_group_dim : g * total_group_dim + q_group_dim + kv_group_dim] = k[g * kv_group_dim : (g + 1) * kv_group_dim]+ qkv[g * total_group_dim + q_group_dim + kv_group_dim : (g + 1) * total_group_dim] = v[g * kv_group_dim : (g + 1) * kv_group_dim]+ mcore_weights[f"decoder.layers.{idx}.self_attention.linear_qkv.weight"] = qkv++ out_proj_key = f"model.layers.{idx}.self_attn.out_proj.weight"+ if out_proj_key in hf_weights:+ mcore_weights[f"decoder.layers.{idx}.self_attention.linear_proj.weight"] = hf_weights[out_proj_key].clone()++ q_ln_key = f"model.layers.{idx}.self_attn.q_layernorm.weight"+ if q_ln_key in hf_weights:+ mcore_weights[f"decoder.layers.{idx}.self_attention.q_layernorm.weight"] = hf_weights[q_ln_key].clone()++ k_ln_key = f"model.layers.{idx}.self_attn.k_layernorm.weight"+ if k_ln_key in hf_weights:+ mcore_weights[f"decoder.layers.{idx}.self_attention.k_layernorm.weight"] = hf_weights[k_ln_key].clone()++ elif ltype == "conv":+ in_proj_key = f"model.layers.{idx}.conv.in_proj.weight"+ if in_proj_key in hf_weights:+ mcore_weights[f"decoder.layers.{idx}.self_attention.in_proj.weight"] = hf_weights[in_proj_key].clone()++ conv_key = f"model.layers.{idx}.conv.conv.weight"+ if conv_key in hf_weights:+ mcore_weights[f"decoder.layers.{idx}.self_attention.conv.weight"] = hf_weights[conv_key].clone()++ out_proj_key = f"model.layers.{idx}.conv.out_proj.weight"+ if out_proj_key in hf_weights:+ mcore_weights[f"decoder.layers.{idx}.self_attention.out_proj.weight"] = hf_weights[out_proj_key].clone()++ ckpt_dir = save_path / "iter_0000001" / "mp_rank_00"+ ckpt_dir.mkdir(parents=True, exist_ok=True)++ args = argparse.Namespace(+ num_layers=config.get("num_hidden_layers", 16),+ hidden_size=hidden_size,+ ffn_hidden_size=8192,+ num_attention_heads=num_heads,+ num_query_groups=num_groups,+ kv_channels=head_dim,+ seq_length=4096,+ max_position_embeddings=4096,+ padded_vocab_size=config.get("vocab_size", 65536),+ make_vocab_size_divisible_by=1,+ tensor_model_parallel_size=1,+ pipeline_model_parallel_size=1,+ position_embedding_type="rope",+ rotary_percent=1.0,+ rotary_base=config.get("rope_theta", 1000000),+ normalization="RMSNorm",+ norm_epsilon=config.get("norm_eps", 1e-5),+ swiglu=True,+ bf16=True,+ untie_embeddings_and_output_weights=False,+ )++ checkpoint = {+ "args": args,+ "checkpoint_version": 3.0,+ "iteration": 1,+ "model": mcore_weights,+ }++ torch.save(checkpoint, ckpt_dir / "model_optim_rng.pt")+ (save_path / "latest_checkpointed_iteration.txt").write_text("1\n", encoding="utf-8")+ print(f"Successfully converted HF checkpoint from {load_dir} to MCore at {save_dir}")+++def mcore_to_hf(load_dir: str, save_dir: str, config_dir: str | None = None):+ load_path = Path(load_dir)+ save_path = Path(save_dir)++ config_source = Path(config_dir) if config_dir else load_path+ config_path = config_source / "config.json"+ if config_path.exists():+ with open(config_path, "r", encoding="utf-8") as f:+ config = json.load(f)+ else:+ config = {}++ layer_types = config.get("layer_types", DEFAULT_LAYER_TYPES)+ hidden_size = config.get("hidden_size", 2048)+ num_heads = config.get("num_attention_heads", 32)+ num_kv_heads = config.get("num_key_value_heads", 8)+ head_dim = hidden_size // num_heads+ num_groups = num_kv_heads+ heads_per_group = num_heads // num_groups+ q_group_dim = heads_per_group * head_dim+ kv_group_dim = head_dim+ total_group_dim = q_group_dim + 2 * kv_group_dim+ ffn_size = 8192++ tracker_file = load_path / "latest_checkpointed_iteration.txt"+ iteration = 1+ if tracker_file.exists():+ try:+ iteration = int(tracker_file.read_text(encoding="utf-8").strip())+ except ValueError:+ iteration = 1++ pt_file = load_path / f"iter_{iteration:07d}" / "mp_rank_00" / "model_optim_rng.pt"+ if not pt_file.exists():+ pt_files = list((load_path / f"iter_{iteration:07d}").glob("*/model_optim_rng.pt"))+ if pt_files:+ pt_file = pt_files[0]+ else:+ raise FileNotFoundError(f"Cannot find model_optim_rng.pt under {load_path}")++ loaded = torch.load(pt_file, map_location="cpu", weights_only=False)+ if "model" in loaded:+ mcore_weights = loaded["model"]+ elif "model0" in loaded:+ mcore_weights = loaded["model0"]+ else:+ mcore_weights = loaded++ hf_weights: Dict[str, torch.Tensor] = {}++ if "embedding.word_embeddings.weight" in mcore_weights:+ hf_weights["model.embed_tokens.weight"] = mcore_weights["embedding.word_embeddings.weight"].clone()+ if "decoder.final_layernorm.weight" in mcore_weights:+ hf_weights["model.embedding_norm.weight"] = mcore_weights["decoder.final_layernorm.weight"].clone()++ for idx, ltype in enumerate(layer_types):+ in_ln_key = f"decoder.layers.{idx}.input_layernorm.weight"+ if in_ln_key in mcore_weights:+ hf_weights[f"model.layers.{idx}.operator_norm.weight"] = mcore_weights[in_ln_key].clone()++ pre_mlp_ln_key = f"decoder.layers.{idx}.pre_mlp_layernorm.weight"+ if pre_mlp_ln_key in mcore_weights:+ hf_weights[f"model.layers.{idx}.ffn_norm.weight"] = mcore_weights[pre_mlp_ln_key].clone()++ fc1_key = f"decoder.layers.{idx}.mlp.linear_fc1.weight"+ if fc1_key in mcore_weights:+ fc1 = mcore_weights[fc1_key]+ hf_weights[f"model.layers.{idx}.feed_forward.w1.weight"] = fc1[:ffn_size, :].clone()+ hf_weights[f"model.layers.{idx}.feed_forward.w3.weight"] = fc1[ffn_size:, :].clone()++ fc2_key = f"decoder.layers.{idx}.mlp.linear_fc2.weight"+ if fc2_key in mcore_weights:+ hf_weights[f"model.layers.{idx}.feed_forward.w2.weight"] = mcore_weights[fc2_key].clone()++ if ltype == "full_attention":+ qkv_key = f"decoder.layers.{idx}.self_attention.linear_qkv.weight"+ if qkv_key in mcore_weights:+ qkv = mcore_weights[qkv_key]+ q = torch.empty((num_heads * head_dim, hidden_size), dtype=qkv.dtype)+ k = torch.empty((num_kv_heads * head_dim, hidden_size), dtype=qkv.dtype)+ v = torch.empty((num_kv_heads * head_dim, hidden_size), dtype=qkv.dtype)+ for g in range(num_groups):+ q[g * q_group_dim : (g + 1) * q_group_dim] = qkv[g * total_group_dim : g * total_group_dim + q_group_dim]+ k[g * kv_group_dim : (g + 1) * kv_group_dim] = qkv[g * total_group_dim + q_group_dim : g * total_group_dim + q_group_dim + kv_group_dim]+ v[g * kv_group_dim : (g + 1) * kv_group_dim] = qkv[g * total_group_dim + q_group_dim + kv_group_dim : (g + 1) * total_group_dim]+ hf_weights[f"model.layers.{idx}.self_attn.q_proj.weight"] = q+ hf_weights[f"model.layers.{idx}.self_attn.k_proj.weight"] = k+ hf_weights[f"model.layers.{idx}.self_attn.v_proj.weight"] = v++ proj_key = f"decoder.layers.{idx}.self_attention.linear_proj.weight"+ if proj_key in mcore_weights:+ hf_weights[f"model.layers.{idx}.self_attn.out_proj.weight"] = mcore_weights[proj_key].clone()++ q_ln_key = f"decoder.layers.{idx}.self_attention.q_layernorm.weight"+ if q_ln_key in mcore_weights:+ hf_weights[f"model.layers.{idx}.self_attn.q_layernorm.weight"] = mcore_weights[q_ln_key].clone()++ k_ln_key = f"decoder.layers.{idx}.self_attention.k_layernorm.weight"+ if k_ln_key in mcore_weights:+ hf_weights[f"model.layers.{idx}.self_attn.k_layernorm.weight"] = mcore_weights[k_ln_key].clone()++ elif ltype == "conv":+ in_proj_key = f"decoder.layers.{idx}.self_attention.in_proj.weight"+ if in_proj_key in mcore_weights:+ hf_weights[f"model.layers.{idx}.conv.in_proj.weight"] = mcore_weights[in_proj_key].clone()++ conv_key = f"decoder.layers.{idx}.self_attention.conv.weight"+ if conv_key in mcore_weights:+ hf_weights[f"model.layers.{idx}.conv.conv.weight"] = mcore_weights[conv_key].clone()++ out_proj_key = f"decoder.layers.{idx}.self_attention.out_proj.weight"+ if out_proj_key in mcore_weights:+ hf_weights[f"model.layers.{idx}.conv.out_proj.weight"] = mcore_weights[out_proj_key].clone()++ save_path.mkdir(parents=True, exist_ok=True)+ save_file(hf_weights, save_path / "model.safetensors")++ if config_dir and Path(config_dir).is_dir():+ for filename in os.listdir(config_dir):+ if filename.endswith((".json", ".jinja", ".txt")):+ src_file = Path(config_dir) / filename+ dst_file = save_path / filename+ if src_file.is_file() and not dst_file.exists():+ shutil.copy2(src_file, dst_file)++ print(f"Successfully converted MCore checkpoint from {load_dir} to HF at {save_dir}")+++def main():+ parser = argparse.ArgumentParser(description="LFM2 Checkpoint Converter")+ subparsers = parser.add_subparsers(dest="subcommand", required=True)++ hf_to_mc = subparsers.add_parser("hf-to-mcore")+ hf_to_mc.add_argument("--load-dir", type=str, required=True, help="Directory containing HF checkpoint")+ hf_to_mc.add_argument("--save-dir", type=str, required=True, help="Directory to save MCore checkpoint")++ mc_to_hf = subparsers.add_parser("mcore-to-hf")+ mc_to_hf.add_argument("--load-dir", type=str, required=True, help="Directory containing MCore checkpoint")+ mc_to_hf.add_argument("--save-dir", type=str, required=True, help="Directory to save HF checkpoint")+ mc_to_hf.add_argument("--config-dir", type=str, default=None, help="Directory containing original HF config files")++ args = parser.parse_args()++ if args.subcommand == "hf-to-mcore":+ hf_to_mcore(args.load_dir, args.save_dir)+ elif args.subcommand == "mcore-to-hf":+ mcore_to_hf(args.load_dir, args.save_dir, args.config_dir)+++if __name__ == "__main__":+ main()@@ -0,0 +1,83 @@+# Copyright (c) 2025, HUAWEI CORPORATION. All rights reserved.+from megatron.core.fusions.fused_bias_dropout import get_bias_dropout_add+from megatron.core.tensor_parallel.layers import ColumnParallelLinear, RowParallelLinear+from megatron.core.transformer.attention import SelfAttention, SelfAttentionSubmodules+from megatron.core.transformer.dot_product_attention import DotProductAttention+from megatron.core.transformer.enums import AttnMaskType+from megatron.core.transformer.identity_op import IdentityOp+from megatron.core.transformer.spec_utils import ModuleSpec+from megatron.core.models.gpt.gpt_layer_specs import _get_mlp_module_spec+from megatron.core.transformer.transformer_block import TransformerBlockSubmodules+from megatron.core.transformer.transformer_layer import TransformerLayer, TransformerLayerSubmodules+from megatron.training import get_args++from mindspeed_llm.core.transformer.custom_layers.transformer_engine import PTNorm+from mindspeed_llm.core.models.lfm2.short_conv import ShortConv, ShortConvSubmodules++LAYER_TYPES = [+ "conv", "conv", "full_attention", "conv",+ "conv", "full_attention", "conv", "conv",+ "full_attention", "conv", "full_attention", "conv",+ "full_attention", "conv", "full_attention", "conv",+]++args = get_args()+num_experts = getattr(args, "num_experts", None)+moe_grouped_gemm = getattr(args, "moe_grouped_gemm", False)+qk_layernorm = getattr(args, "qk_layernorm", False)+use_te = getattr(args, "transformer_impl", "local") == "transformer_engine"++attention_layer_spec = ModuleSpec(+ module=TransformerLayer,+ submodules=TransformerLayerSubmodules(+ input_layernorm=PTNorm,+ self_attention=ModuleSpec(+ module=SelfAttention,+ params={"attn_mask_type": AttnMaskType.causal},+ submodules=SelfAttentionSubmodules(+ linear_qkv=ColumnParallelLinear,+ core_attention=DotProductAttention,+ linear_proj=RowParallelLinear,+ q_layernorm=PTNorm if qk_layernorm else IdentityOp,+ k_layernorm=PTNorm if qk_layernorm else IdentityOp,+ ),+ ),+ self_attn_bda=get_bias_dropout_add,+ pre_mlp_layernorm=PTNorm,+ mlp=_get_mlp_module_spec(+ use_te=use_te, num_experts=num_experts, moe_grouped_gemm=moe_grouped_gemm+ ),+ mlp_bda=get_bias_dropout_add,+ ),+)++conv_layer_spec = ModuleSpec(+ module=TransformerLayer,+ submodules=TransformerLayerSubmodules(+ input_layernorm=PTNorm,+ self_attention=ModuleSpec(+ module=ShortConv,+ params={"conv_kernel": 3},+ submodules=ShortConvSubmodules(+ in_proj=ColumnParallelLinear,+ out_proj=RowParallelLinear,+ ),+ ),+ self_attn_bda=get_bias_dropout_add,+ pre_mlp_layernorm=PTNorm,+ mlp=_get_mlp_module_spec(+ use_te=use_te, num_experts=num_experts, moe_grouped_gemm=moe_grouped_gemm+ ),+ mlp_bda=get_bias_dropout_add,+ ),+)++layer_specs = [+ conv_layer_spec if ltype == "conv" else attention_layer_spec+ for ltype in LAYER_TYPES+]++layer_spec = TransformerBlockSubmodules(+ layer_specs=layer_specs,+ layer_norm=PTNorm,+)