Skip to content

For each kernel, add a standalone path to build the cpp source. - #1

Merged
ShengchenJ merged 4 commits into
mainfrom
standalone_cpp
Oct 12, 2026
Merged

ShengchenJ merged 4 commits into
mainfrom
standalone_cpp

Conversation

@ShengchenJ

Copy link
Copy Markdown
Contributor

No description provided.

Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The runner can mask failed builds, and the GEMM test instructions build the wrong artifact.

4 open findings
What changed in this PR

Adds PyTorch-free standalone build, benchmark, and correctness paths for kernel families, plus GPU-target-specific optimizations.

Changes:

  • Adds configurable standalone/PyTorch builds and CPU-reference harnesses.
  • Adds aggregate standalone build/run automation and GPU target detection.
  • Introduces Xe2/Battlemage conversion, reduction, and launch tuning.
File Description
README.md Documents build modes and harness usage.
kernels/​run_standalone.sh Builds and runs all standalone harnesses.
kernels/​rotary/​rotary.dp.cpp Separates PyTorch and standalone paths.
kernels/​rotary/​rotary_qk.dp.cpp Adds standalone Q/K rotary path.
kernels/​rotary/​rotary_qk_harness.impl Validates combined rotary kernels.
kernels/​rotary/​rotary_harness.impl Validates standalone rotary.
kernels/​rotary/​rope_kvwrite.dp.cpp Adds standalone KV-write path.
kernels/​rotary/​rope_kvwrite_harness.impl Validates rotary cache writes.
kernels/​rotary/​Makefile Adds rotary build modes.
kernels/​norm/​rmsnorm.dp.cpp Guards PyTorch RMSNorm bindings.
kernels/​norm/​rmsnorm_harness.impl Benchmarks and validates RMSNorm.
kernels/​norm/​Makefile Adds normalization build modes.
kernels/​norm/​layernorm.dp.cpp Guards PyTorch LayerNorm bindings.
kernels/​norm/​layernorm_harness.impl Benchmarks and validates LayerNorm.
kernels/​gemm/​test_bf16_gemm.py Adds extension correctness benchmark.
kernels/​gemm/​qkv_gemm.dp.cpp Adds standalone QKV GEMM path.
kernels/​gemm/​qkv_gemm_harness.impl Validates fused and split QKV output.
kernels/​gemm/​Makefile Adds GEMM build modes.
kernels/​gemm/​bf16_gemm.dp.cpp Extracts shared raw-pointer GEMM entry.
kernels/​gemm/​bf16_gemm_harness.impl Validates standalone BF16 GEMM.
kernels/​detect_gpu_target.sh Detects local Intel GPU architecture.
kernels/​decode/​Makefile Adds standalone decode build.
kernels/​decode/​decode.dp.cpp Extracts shared decode orchestration core.
kernels/​decode/​decode_harness.impl Validates multi-layer decode.
kernels/​common.mk Defines configurations and GPU tuning flags.
kernels/​attention/​Makefile Adds attention build modes.
kernels/​attention/​gqa_forward.dp.cpp Extracts shared forward entry and BMG tuning.
kernels/​attention/​gqa_forward_harness.impl Validates forward attention.
kernels/​attention/​gqa_backward.dp.cpp Extracts shared backward entries.
kernels/​attention/​gqa_backward_harness.impl Validates attention gradients.
kernels/​activation/​silu_mul.dp.cpp Adds standalone activation path.
kernels/​activation/​silu_mul_harness.impl Validates SiLU multiplication.
kernels/​activation/​Makefile Adds activation build modes.
include/​ops/​warp/​register/​tile/​reductions.dp.hpp Optimizes SIMD row reductions.
include/​common/​base_types.dp.hpp Adds fast packed BF16 conversion.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread kernels/gemm/test_bf16_gemm.py Outdated
Comment thread kernels/run_standalone.sh Outdated
Comment on lines +29 to +33
wait
build_fail=0
for d in $DIRS; do
if grep -q -E "Error [0-9]|error:" "$d/build/standalone.log"; then
echo " $d: BUILD FAILED (see $d/build/standalone.log)"; build_fail=1
Comment thread kernels/run_standalone.sh
Comment thread kernels/common.mk
ShengchenJ and others added 3 commits October 11, 2026 22:49
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
Move the B70 tuning (GPU target detection, large GRF, KITTENS_BMG dispatch rule,
bf16_2 conversion, transposing row reduction) out of this branch; it now lives on
the separate b70_tune branch. Drop kernels/gemm/test_bf16_gemm.py, which is
covered by bf16_gemm_harness.impl.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
Build failure was inferred from "Error N" / "error:" in the logs, which misses
failures such as "*** CONFIG must be ... Stop." and then ran executables left
over from an earlier build. Wait on each background make and use its exit
status; skip the binaries of any directory whose build failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
@ShengchenJ
ShengchenJ merged commit 9432113 into main Oct 12, 2026
6 checks passed
@ShengchenJ
ShengchenJ deleted the standalone_cpp branch October 12, 2026 06:59
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