Skip to content

[CI Test] TRID DMA barrier lowering#1

Closed
shutovilyaep wants to merge 4 commits into
mainfrom
feat/lower_copy_wait
Closed

[CI Test] TRID DMA barrier lowering#1
shutovilyaep wants to merge 4 commits into
mainfrom
feat/lower_copy_wait

Conversation

@shutovilyaep
Copy link
Copy Markdown
Owner

@shutovilyaep shutovilyaep commented Feb 27, 2026

deprecated in favor of #2

Add use-trid-barriers option to convert-ttl-to-ttkernel pass and
ttl-to-ttkernel-pipeline. When enabled, ttl.copy emits
noc_async_{read,write}_set_trid before DMA operations, and ttl.wait
emits noc_async_{read,write}_barrier_with_trid instead of global
barriers.

Default behavior (use-trid-barriers=false) preserves existing global
barrier semantics from main branch.

Key changes:
- TridAllocator class manages 16 TRID slots with overflow handling
- CopyLowering/WaitLowering patterns respect useTridBarriers flag
- TTKernel cleanup patterns conditionally registered for TRID mode
- SCF structural type conversions enabled for transfer handle types

Addresses: tenstorrent#87
- trid_barriers.mlir: Tests TRID-aware lowering with use-trid-barriers=true
  - Verifies noc_async_{read,write}_set_trid emission
  - Verifies noc_async_{read,write}_barrier_with_trid emission
  - Tests TRID overflow handling (17 copies without waits)

- dma_global_barriers.mlir: Tests default global barrier mode
  - Verifies noc_async_{read,write}_barrier emission (no TRID)
  - Ensures backward compatibility with main branch behavior

- Update existing tests to use explicit use-trid-barriers=true where
  they expect TRID-specific output
Enable use-trid-barriers in TTLToCpp translation tests that verify
TRID-specific C++ codegen output. Tests now explicitly request TRID
mode to match their expected noc_async_*_set_trid and
barrier_with_trid output.
Add use_trid_barriers to E2EConfig and TestConfig to enable runtime
testing of both barrier modes:

- E2EConfig.use_trid_barriers controls pipeline pass option
- TestConfig includes use_trid_barriers for test ID disambiguation
- Pipeline builder forwards option to convert-ttl-to-ttkernel
- Runner includes use_trid_barriers in kernel cache key
- CONFIGS includes one TRID-enabled config for coverage

Test IDs now include _trid suffix when use_trid_barriers=True to
ensure unique pytest node IDs.
@shutovilyaep shutovilyaep force-pushed the feat/lower_copy_wait branch 2 times, most recently from 37c11ba to 2dba10e Compare February 27, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant