Skip to content

[CI Test] TRID DMA barrier lowering (with runner fix)#2

Open
shutovilyaep wants to merge 5 commits into
mainfrom
feat/lower_copy_wait_fork_ci
Open

[CI Test] TRID DMA barrier lowering (with runner fix)#2
shutovilyaep wants to merge 5 commits into
mainfrom
feat/lower_copy_wait_fork_ci

Conversation

@shutovilyaep
Copy link
Copy Markdown
Owner

@shutovilyaep shutovilyaep commented Feb 27, 2026

Purpose

Internal CI test PR with workflow fix to run on standard GitHub runners.

Includes commit: [PRIVATE REPO FIX - NO mlir-large-runner-lang]

This branch is separate from the upstream PR to avoid polluting it with fork-specific fixes.

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.
Replace mlir-large-runner-lang with ubuntu-latest for CI builds.
This allows the workflow to run on forks without access to
Tenstorrent's self-hosted runners.

Note: Build may timeout or fail due to resource limits on
standard GitHub runners.

Made-with: Cursor
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