forked from ccf-ai-infra/TileOPs-Metax
Implement QuantSwiGLUFwdChannelCastTransposeOp and flip its manifest status to implemented: fused SwiGLU forward (silu(gate)*value) + per-token-block FP8 e4m3 cast with optional transpose, returning a packed FP8 output plus an fp32 per-block scaling-factor tensor. Faithful port of swiglu_forward_and_per_channel_cast_and_transpose from MetaX-MACA/TileKernels-Metax @ 0266ab7 (tile_kernels/quant/). The kernel tiles tokens x hidden, stages the activation in shared memory, reduces the per-block absmax (packed-bf16 in the non-transpose path, fp32 fragment in the transpose path), and emits the quantized output. - kernel: tileops/kernels/quant_swiglu_channel_cast_transpose.py - op: tileops/ops/quant_swiglu_channel_cast_transpose.py - workload, correctness tests, manifest-driven baseline benchmark - manifest: status spec-only -> implemented, source.kernel_map added Baseline (MetaX C500, 50% compute slice): 4.7-9.4x faster than the torch reference; 0.24-0.36 TB/s achieved on roofline bytes (kernel is not yet bandwidth-saturated). See logs/2026-08-03_baseline_notes.md. Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| hardware | ||
| kernels | ||
| ops | ||
| tests | ||
| __init__.py | ||
| benchmark_base.py | ||
| conftest.py | ||