wai-quantum 0.6.1: the CUDA tensor-core kernel and the Metal member #275
Loading…
Reference in a new issue
No description provided.
Delete branch "wai/quantum-tensor-cores"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two additions to wai-quantum, released together as 0.6.1 (additive; every pinned digest unchanged):
quantum_fabric_metal, macOS), with an exact integer kernel and a second kernel whose every product uses the GPU's SIMD-group matrix multiply.Both matrix paths use the same argument (below), and each kernel has its own implementation id and mutants.
1. The CUDA tensor-core kernel
tensor_limbs.cu: a second CUDA kernel for the gate, whose every product is formed on the tensor cores. It runs on devices of compute capability 8.0 or later.How it stays exact
mma.syncm16n8k16steps, accumulated in f32.2^16, and every coefficient sums at most four of them. So every value the tensor core forms is an integer below2^18, which f32 holds exactly in any order of addition.8sbits, in 64-bit integers. That gives the exact product; the rest of the gate is the other kernel's arithmetic.API (additive, 0.6.1)
cuda::TENSOR_SOURCE,TENSOR_IMPLEMENTATION,tensor_implementation_id{,_of},TENSOR_MUTANTS,tensor_mutate,TENSOR_MIN_COMPUTE,TENSOR_THREADS_PER_ITEM,DeviceIdentity::has_tensor_cores.CudaMember::tensor(): the same device, member id unchanged, under the kernel's own implementation id (cuda-tensor-limbs8/…). It is probed before it is returned.CudaError::Unsupported(new) for a device below 8.0.Mutants (7)
2^28Measured
On jetson-hub's discrete GPU (sm_89, silicon),
tests/cuda_tensor.rspassed 9/9:d18454c6…,41c726a0…,3dbde276…,9a84b55a…).cuda_member(9/9, 6 of 6 mutants) andcuda_sv(3/3, pinb7d129d0…) pass unchanged on the same tree.On the build host, which has no CUDA library,
cuda_tensorandcuda_membereach pass 9/9 over no device (none).I checked the workflow's report checks against the real report: the device set, the member line, 4 certificates and 7 of 7 mutants all match.
CI
wai-quantum-cuda, cuda-hw job: a new tensor-core step that requires 9 passed, the member line, 4cuda-tensor-limbs8certificates and 7 of 7 mutants.2. The Metal member
quantum_fabric_metal(opt-in, macOS) runs the gate on the platform's GPU through its own interface. The operating system's compiler builds the kernels at run time. The state lives in one buffer the GPU and the host share, and each gate is one serial dispatch in a single command buffer.lanes64.metal(metal-lanes64/…): the CUDA kernel's exact 64-bit integer arithmetic in the Metal shading language.matrix_limbs.metal(metal-matrix-limbs8/…,MetalMember::matrix()): every product formed by the SIMD-group matrix multiply, from 8-bit limbs in bf16 accumulated in f32.MetalError::Unsupported.gpu-msl-<family>), not a vendor name. The member id binds the device, its registry id, family and memory, and the operating system's version.Mutants
Measured
On the M3 Ultra build host, the same machine as the
macosrunner (GPU family 1009, silicon),metal_memberandmetal_matrixeach passed 9/9:On Linux (jetson-hub), the unit tests pass, both suites pass 9/9 over no device, and clippy is clean. Clippy is also clean on macOS, and I checked the workflow's report greps against the real report.
Not done: Metal 4's tensor-op multiply, the path to M5's GPU neural accelerators. The only M5 in the fleet is the dev Mac, where builds and tests are off-limits.
CI
wai-quantum-metal:macosrunner: unit tests; 9 passed, 4 certificates and 6 of 6 mutants for the integer kernel; then the member line, 4 matrix certificates and 7 of 7 mutants for the matrix kernel.linux: both suites over no device, plus the off-platform discovery test.The CHANGELOG also records two hand measurements made outside CI: the tensor program on a cloud tensor processor, and the QPU crate against its service's simulator.
All repo checks are clean: prose, vanity metrics, tests-in-CI, concurrency, lockfiles, orphans and public names.
🤖 Generated with Claude Code
wai-quantum 0.6.1: the CUDA member's tensor-core kernelto wai-quantum 0.6.1: the CUDA tensor-core kernel and the Metal member