Skip to content

[dicp] Implement Stage-Major Unrolling and NPU Pipeline Analysis#136

Closed
Truth-Ke wants to merge 1 commit intomainfrom
kzx/dev
Closed

[dicp] Implement Stage-Major Unrolling and NPU Pipeline Analysis#136
Truth-Ke wants to merge 1 commit intomainfrom
kzx/dev

Conversation

@Truth-Ke
Copy link
Copy Markdown
Collaborator

This commit introduces a robust framework for software pipelining on NPU targets by implementing stage-based loop partitioning and unrolling.

  1. StageDependencyAnalyzer:

    • Partitions scf.for loops into stages via sync primitives.
    • Builds dependency DAGs using SSA and AliasAnalysis for safe reordering.
  2. DimAnalyzer & DimensionDisjointSet:

    • Uses DSU to track dimension equivalence across operations.
    • Propagates Parallel/Reduction properties to guide tiling heuristics.
  3. NPUUnrollPipeline:

    • Executes Stage-Major unrolling with automated Hivm flag management.
    • Handles complex iter_arg propagation across unrolled iterations.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 20, 2026

CLA assistant check
All committers have signed the CLA.

@Truth-Ke Truth-Ke force-pushed the kzx/dev branch 4 times, most recently from efc96a8 to 3238677 Compare January 21, 2026 07:30
@Truth-Ke Truth-Ke force-pushed the kzx/dev branch 6 times, most recently from 3b3d81d to 4ccf701 Compare March 27, 2026 11:53
This commit introduces the CPU verification mechanism to validate Triton
kernels without NPU hardware. Key changes include:

- Add cpu_backend.py: CPU-based execution backend using LLVM/MLIR infrastructure
- Add DebugCPUVerifyPass: Validates that external dialect ops are lowered before CPU execution
- Add test/ascend/cpu_verify/: Minimal test cases for vec_add, matmul, and flash attention

Usage:
  export DLC_CPU_VERIFY=1
  export LLVM_BINARY_DIR=/path/to/llvm/bin
  python test/ascend/cpu_verify/test_vec_add.py

The CPU backend converts Triton IR to LLVM IR via MLIR passes and executes
natively on CPU for rapid iteration and debugging.
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.

2 participants