Skip to content

Phase9#18

Merged
dmriding merged 80 commits into
mainfrom
phase9
Jun 12, 2026
Merged

Phase9#18
dmriding merged 80 commits into
mainfrom
phase9

Conversation

@dmriding

Copy link
Copy Markdown
Owner

No description provided.

dmriding added 30 commits May 14, 2026 17:20
First bench run on RTX 4090 sm_89, median TFLOPS per shape:

  Size              f16 TF   bf16 TF   bf16/f16
  256x256x256         0.09      0.09      94.1%
  512x512x512         0.68      0.68      99.9%
  1024x1024x1024      4.74      5.22     110.1%
  2048x2048x2048     26.69     26.75     100.2%
  4096x4096x4096     53.83     55.59     103.3%

SC-2 gate at 4096³ (worst-of-10):
  f16  worst-of-10: 2.33 ms / 58.96 TF
  bf16 worst-of-10: 2.29 ms / 59.96 TF
  bf16/f16 (TFLOPS): 101.70% (delta +1.70%, well inside ±5% bound)

bf16 at 4096³ is 91.8% of cuBLAS sgemm — same regime as f16 (82.3% per
existing perf doc). Comparison is project-local reference, not apples-
to-apples; the cublasGemmEx-bf16 future reference is tracked at C8.
Breaking (kaio-core IR, pre-v1.0): PtxModule::validate now returns
ValidationError::MmaSyncBf16Rejected when MmaSync is constructed with
PtxType::BF16 on a_ty or b_ty. Bf16 mma emission must use MmaSyncBf16.
This closes a legacy hole where the generic MmaSync path silently
emitted bf16 PTX from FragmentA_F16/FragmentB_F16 operands, defeating
the D2 sibling-IR design intent.

Inverts the prior emit_mma_sync_m16n8k16_bf16_f32 regression test
(which documented the footgun) and adds four new validation tests.
Updates the 5 existing SmTooLow match sites in kaio-ops to handle the
new variant.
…d min_normal class

The near_denorm class name was inaccurate: inputs [1e-18, ~1.94e-18]
are normal bf16 values 20 orders of magnitude above min-normal
(~1.175e-38), so the class did not cover what its name promised.

Rename:
- patterned_bf16_near_denorm -> patterned_bf16_tiny_product
- assert_bf16_close_d5_near_denorm -> assert_bf16_close_d5_relative_only
- 4 tc_bf16_*_near_denorm tests -> tc_bf16_*_tiny_product

New min_normal magnitude class with asymmetric magnitudes — A in
bf16's min-normal exponent band [2e-38, ~3.88e-38] (just above the
~1.175e-38 normal/subnormal boundary), B large positive [1e10,
~1.94e10]. Per-element products land at ~2e-28, normal-f32 range,
so the f32 accumulator does not underflow. Isolates the
FTZ-on-load failure mode on the bf16 side.

4 new tc_bf16_*_min_normal tests at 32³/64³/256³/512³, symmetric
with the existing magnitude grid. Total bf16 correctness suite:
21 -> 25 tests.
…README

- README.md: add Tensor-core matmul (bf16) row to the feature summary,
  API + constraints only (perf table deferred to v0.5.0 aggregate).
- kaio-ops/README.md: full refresh against current lib.rs exports. The
  prior README only listed scalar matmul + scalar attention; the
  refreshed version lists every shipped op (matmul, matmul_tc family,
  matmul_tc_bf16, matmul_int8, matmul_int4, attention family,
  qkv_project_int8/int4, auto-tuner variants) with min-SM + divisibility
  constraints, and defers perf numbers to docs/performance.md per the
  Phase 9 master-plan rule.
- docs/phases.md: mark Phase 9 in-progress (9.1 shipped 2026-05-14)
  instead of "Planned".
SC-2 at 4096^3 on RTX 4090 sm_89: median ratio 100.72% (delta +0.72%,
bound +/-3%), worst ratio 101.55% (delta +1.55%, bound +/-15%). bf16_async
59.65 TFLOPS / f16_async 59.30 TFLOPS in the per-shape table; ratios
cluster tight (99.70%-101.55%) across 10 interleaved alternating-order
runs.
dmriding added 29 commits June 12, 2026 00:14
@dmriding dmriding merged commit dabd57d into main Jun 12, 2026
5 checks passed
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