From bb8ff44667f706b1faf0b0a56fd505bb1cfa4913 Mon Sep 17 00:00:00 2001 From: Pavlo Ratushnyi Date: Mon, 23 Nov 2026 22:37:24 +0100 Subject: [PATCH] Sealed PTX: scrub engine/strata from four PTX header comments and their sm_86 companions, re-pin (STRA-407) bf16_f32_mmvf, iq3_s_q8_1, moe_group_iq3_s, moe_group_iq3_s_nc4 (sm_120 in src/, sm_86 in ptx-sm86/) change in // header comments only (proof: identical after comment stripping, no .file/.loc directive or string carries the path). The sm_86 companions are re-derived with sm86_assets.retarget + ptxas -arch=sm_86 (== the edited files); MANIFEST.json (sm120/sm86 sha256 and byte counts of the four, the -I flags of the one recompiled companion) and the five-part sm86_table rows (new keys, re-sorted, same 27/27/27/27/23 layout) follow; FORMER_TABLE_DIGEST is recomputed with the algorithm of its test (reproduces the old value on main). Rust pins that cover the changed bytes: bf16_receipt_types.rs BF16_RECEIPT (.cu source_sha256 and bf16_f32_mmvf.ptx ptx_sha256; a Receipt, not a PtxPin, so patched token by token), the frozen-artifact hash of iq3_s_q8_1.ptx in context_handle.rs and in scripts/test-cuda-projection-family-driver.sh. Instruction streams, entry names and pinned symbol names are untouched. --- crates/cuda-driver/ptx-sm86/MANIFEST.json | 38 +++++++------- crates/cuda-driver/ptx-sm86/bf16_f32_mmvf.ptx | 2 +- crates/cuda-driver/ptx-sm86/iq3_s_q8_1.ptx | 4 +- .../cuda-driver/ptx-sm86/moe_group_iq3_s.ptx | 4 +- .../ptx-sm86/moe_group_iq3_s_nc4.ptx | 4 +- crates/cuda-driver/src/bf16_f32_mmvf.ptx | 2 +- crates/cuda-driver/src/ffi/context_handle.rs | 2 +- crates/cuda-driver/src/iq3_s_q8_1.ptx | 4 +- crates/cuda-driver/src/moe_group_iq3_s.ptx | 4 +- .../cuda-driver/src/moe_group_iq3_s_nc4.ptx | 4 +- .../src/qwen_ffi/bf16_receipt_types.rs | 8 +-- crates/cuda-driver/src/sm86_table.rs | 2 +- .../sm86_table/companion_rows_highest_keys.rs | 26 +++++----- .../sm86_table/companion_rows_lower_keys.rs | 52 +++++++++---------- .../sm86_table/companion_rows_lowest_keys.rs | 26 +++++----- .../sm86_table/companion_rows_middle_keys.rs | 52 +++++++++---------- .../sm86_table/companion_rows_upper_keys.rs | 52 +++++++++---------- scripts/test-cuda-projection-family-driver.sh | 2 +- 18 files changed, 144 insertions(+), 144 deletions(-) diff --git a/crates/cuda-driver/ptx-sm86/MANIFEST.json b/crates/cuda-driver/ptx-sm86/MANIFEST.json index 7834ed73..1b30b512 100644 --- a/crates/cuda-driver/ptx-sm86/MANIFEST.json +++ b/crates/cuda-driver/ptx-sm86/MANIFEST.json @@ -124,13 +124,13 @@ "count": 3 } ], - "sm120_bytes": 5980, + "sm120_bytes": 5983, "sm120_nvcc": null, "sm120_path": "crates/cuda-driver/src/bf16_f32_mmvf.ptx", - "sm120_sha256": "044543f681bb23eb9cae602b1a16aa7b2386d6d5c3b15cc41987338bd613b1c3", + "sm120_sha256": "8b0d71f343f2b2b34b0e742e3bb08c2192be33e8016c2136e63fc7f34f477aaa", "sm120_stored_nul": false, - "sm86_bytes": 5874, - "sm86_sha256": "54a33146558ef76c817fc8e556f709228f90e2ccd6565f57c4f8ec4646e6c442" + "sm86_bytes": 5877, + "sm86_sha256": "29e6a266d9608df5ff00c87ca8296c55f4ea53ed4d1fe01f0b785b76984d4318" }, { "entries": 19, @@ -476,13 +476,13 @@ "count": 1 } ], - "sm120_bytes": 24712, + "sm120_bytes": 24718, "sm120_nvcc": "13.0.88", "sm120_path": "crates/cuda-driver/src/iq3_s_q8_1.ptx", - "sm120_sha256": "94f798c00813c2fb860b4bf77be9225767d408955e3421330ac34a4ebd43978f", + "sm120_sha256": "ebfcabd456b8cf16608c529b906849e4391096322a88e5a665ac87657a91dde6", "sm120_stored_nul": false, - "sm86_bytes": 24711, - "sm86_sha256": "b19860070e69dccd5e98d1e6bc7cddcda2928efbd3f0bd21568fd1ae7d4ae927" + "sm86_bytes": 24717, + "sm86_sha256": "46a64e151bbdfe0e5b3a4b36e6abab396aeed026872b608e76b9a482bea8240a" }, { "entries": 1, @@ -916,13 +916,13 @@ "count": 1 } ], - "sm120_bytes": 25114, + "sm120_bytes": 25120, "sm120_nvcc": "13.0.88", "sm120_path": "crates/cuda-driver/src/moe_group_iq3_s.ptx", - "sm120_sha256": "58d068ff3acc4211614f70ab04703a40858e148f9aef8503ed66f7640ae2e2aa", + "sm120_sha256": "46b0d5365a1529c65f478aa5335089e56eb624370f9c17c87e79b7369f0e7b8a", "sm120_stored_nul": false, - "sm86_bytes": 25113, - "sm86_sha256": "36c2f68c0d3a3c524787ecf03a1f33e2da930a4917419ea5893ccaa28c33a88c" + "sm86_bytes": 25119, + "sm86_sha256": "0e5e0434421077516213079c02d9f98ff4bcfa46347903786e1decd520bbfd14" }, { "entries": 2, @@ -936,13 +936,13 @@ "count": 1 } ], - "sm120_bytes": 36382, + "sm120_bytes": 36388, "sm120_nvcc": "13.0.88", "sm120_path": "crates/cuda-driver/src/moe_group_iq3_s_nc4.ptx", - "sm120_sha256": "be6ee907c0b370cb99894a03419466f1aa465ba9b8e2e8cf603887f534450d0c", + "sm120_sha256": "7a13911f998d38bba5c52862f92799d17a662e8427c1cdff24f01c1f30a7fd94", "sm120_stored_nul": false, - "sm86_bytes": 36381, - "sm86_sha256": "23b702aaf1278dd3d436142b9c27321921f36dda7606d1f756973e5dfcbd4537" + "sm86_bytes": 36387, + "sm86_sha256": "e12dea8f921efd99c9483012f8da00c5ba1ba66b0444ff4ba98fed4903ed51e5" }, { "entries": 1, @@ -1635,12 +1635,12 @@ "-std=c++17", "--fmad=true", "--ftz=false", - "-Iengine/strata/include", - "-Iengine/strata/third_party/ggml", + "-Istrata-41cf05a0/include", + "-Istrata-41cf05a0/third_party/ggml", "-Icrates/cuda-driver/src/third_party/llamacpp/ggml-cuda", "-Icrates/cuda-driver/src/third_party/llamacpp/ggml-include", "-Icrates/cuda-driver/src/third_party/llamacpp/ggml-src", - "-Iengine/strata/src" + "-Istrata-41cf05a0/src" ], "isa": "9.2", "method": "recompile", diff --git a/crates/cuda-driver/ptx-sm86/bf16_f32_mmvf.ptx b/crates/cuda-driver/ptx-sm86/bf16_f32_mmvf.ptx index 8df695c4..052e122b 100644 --- a/crates/cuda-driver/ptx-sm86/bf16_f32_mmvf.ptx +++ b/crates/cuda-driver/ptx-sm86/bf16_f32_mmvf.ptx @@ -1,5 +1,5 @@ // Adapted from the pinned native operation: -// engine/strata/src/kernels/cuda/native_bf16.cu +// Strata 41cf05a0, src/kernels/cuda/native_bf16.cu // SHA-256 70b44795528fb73d636be5914d60f0adaa849a48cc38f309d327a2976c3ed3da // and exact BF16 bit expansion in bf16_bits.hpp // SHA-256 813b51f17c5c264d642f4d77b3d6e5f35e7ea7310ba87b18b3a2a5bc9185198f. diff --git a/crates/cuda-driver/ptx-sm86/iq3_s_q8_1.ptx b/crates/cuda-driver/ptx-sm86/iq3_s_q8_1.ptx index c3b586d1..05588906 100644 --- a/crates/cuda-driver/ptx-sm86/iq3_s_q8_1.ptx +++ b/crates/cuda-driver/ptx-sm86/iq3_s_q8_1.ptx @@ -1,7 +1,7 @@ // IQ3_S Q8_1 routed projection; derived from llama.cpp/ggml native Fmt21. // Copyright (c) 2023-2026 The ggml authors. MIT License. -// Native source: engine/strata/src/kernels/cuda/iq_kernels.cu SHA256 07fe5567a7fc75a079dcc7887975dffe490607564c16ad884423b903ab08a537 -// Grid source: engine/strata/third_party/ggml/ggml-common.h SHA256 0061131b615c5721fc88a78feeb22c1f8c450f1c2646a317d80796a653bf595c +// Native source: Strata 41cf05a0, src/kernels/cuda/iq_kernels.cu SHA256 07fe5567a7fc75a079dcc7887975dffe490607564c16ad884423b903ab08a537 +// Grid source: Strata 41cf05a0, third_party/ggml/ggml-common.h SHA256 0061131b615c5721fc88a78feeb22c1f8c450f1c2646a317d80796a653bf595c // Full MIT notice is retained in crates/quant-core/LICENSE-GGML. // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/crates/cuda-driver/ptx-sm86/moe_group_iq3_s.ptx b/crates/cuda-driver/ptx-sm86/moe_group_iq3_s.ptx index 43f43e66..6d7d2ef5 100644 --- a/crates/cuda-driver/ptx-sm86/moe_group_iq3_s.ptx +++ b/crates/cuda-driver/ptx-sm86/moe_group_iq3_s.ptx @@ -1,7 +1,7 @@ // IQ3_S Q8_1 routed projection; derived from llama.cpp/ggml native Fmt21. // Copyright (c) 2023-2026 The ggml authors. MIT License. -// Native source: engine/strata/src/kernels/cuda/iq_kernels.cu SHA256 07fe5567a7fc75a079dcc7887975dffe490607564c16ad884423b903ab08a537 -// Grid source: engine/strata/third_party/ggml/ggml-common.h SHA256 0061131b615c5721fc88a78feeb22c1f8c450f1c2646a317d80796a653bf595c +// Native source: Strata 41cf05a0, src/kernels/cuda/iq_kernels.cu SHA256 07fe5567a7fc75a079dcc7887975dffe490607564c16ad884423b903ab08a537 +// Grid source: Strata 41cf05a0, third_party/ggml/ggml-common.h SHA256 0061131b615c5721fc88a78feeb22c1f8c450f1c2646a317d80796a653bf595c // Full MIT notice is retained in crates/quant-core/LICENSE-GGML. // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/crates/cuda-driver/ptx-sm86/moe_group_iq3_s_nc4.ptx b/crates/cuda-driver/ptx-sm86/moe_group_iq3_s_nc4.ptx index 5c23688f..542a3f8b 100644 --- a/crates/cuda-driver/ptx-sm86/moe_group_iq3_s_nc4.ptx +++ b/crates/cuda-driver/ptx-sm86/moe_group_iq3_s_nc4.ptx @@ -5,8 +5,8 @@ // Tail activation loads clamp to last genuine pointer; only live stores write. // IQ3_S Q8_1 routed projection; derived from llama.cpp/ggml native Fmt21. // Copyright (c) 2023-2026 The ggml authors. MIT License. -// Native source: engine/strata/src/kernels/cuda/iq_kernels.cu SHA256 07fe5567a7fc75a079dcc7887975dffe490607564c16ad884423b903ab08a537 -// Grid source: engine/strata/third_party/ggml/ggml-common.h SHA256 0061131b615c5721fc88a78feeb22c1f8c450f1c2646a317d80796a653bf595c +// Native source: Strata 41cf05a0, src/kernels/cuda/iq_kernels.cu SHA256 07fe5567a7fc75a079dcc7887975dffe490607564c16ad884423b903ab08a537 +// Grid source: Strata 41cf05a0, third_party/ggml/ggml-common.h SHA256 0061131b615c5721fc88a78feeb22c1f8c450f1c2646a317d80796a653bf595c // Full MIT notice is retained in crates/quant-core/LICENSE-GGML. // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/crates/cuda-driver/src/bf16_f32_mmvf.ptx b/crates/cuda-driver/src/bf16_f32_mmvf.ptx index 2c02e385..69d98c1d 100644 --- a/crates/cuda-driver/src/bf16_f32_mmvf.ptx +++ b/crates/cuda-driver/src/bf16_f32_mmvf.ptx @@ -1,5 +1,5 @@ // Adapted from the pinned native operation: -// engine/strata/src/kernels/cuda/native_bf16.cu +// Strata 41cf05a0, src/kernels/cuda/native_bf16.cu // SHA-256 70b44795528fb73d636be5914d60f0adaa849a48cc38f309d327a2976c3ed3da // and exact BF16 bit expansion in bf16_bits.hpp // SHA-256 813b51f17c5c264d642f4d77b3d6e5f35e7ea7310ba87b18b3a2a5bc9185198f. diff --git a/crates/cuda-driver/src/ffi/context_handle.rs b/crates/cuda-driver/src/ffi/context_handle.rs index 040f2bb6..58349cf0 100644 --- a/crates/cuda-driver/src/ffi/context_handle.rs +++ b/crates/cuda-driver/src/ffi/context_handle.rs @@ -121,7 +121,7 @@ fn routed_ptx(format: RoutedFormat) -> &'static [u8] { // standalone installed-Driver proof is distinct from composition. RoutedFormat::IQ3_XXS => concat!(include_str!("../iq3_xxs_q8_1.ptx"), "\0").as_bytes(), // Root-delivered STRA-149 frozen routed artifact - // 94f798c00813c2fb860b4bf77be9225767d408955e3421330ac34a4ebd43978f. + // ebfcabd456b8cf16608c529b906849e4391096322a88e5a665ac87657a91dde6. RoutedFormat::IQ3_S => concat!(include_str!("../iq3_s_q8_1.ptx"), "\0").as_bytes(), // Root-delivered STRA-150 frozen routed artifact a31e653d. RoutedFormat::IQ2_S => concat!(include_str!("../iq2_s_q8_1.ptx"), "\0").as_bytes(), diff --git a/crates/cuda-driver/src/iq3_s_q8_1.ptx b/crates/cuda-driver/src/iq3_s_q8_1.ptx index afa0a63c..063a8ca8 100644 --- a/crates/cuda-driver/src/iq3_s_q8_1.ptx +++ b/crates/cuda-driver/src/iq3_s_q8_1.ptx @@ -1,7 +1,7 @@ // IQ3_S Q8_1 routed projection; derived from llama.cpp/ggml native Fmt21. // Copyright (c) 2023-2026 The ggml authors. MIT License. -// Native source: engine/strata/src/kernels/cuda/iq_kernels.cu SHA256 07fe5567a7fc75a079dcc7887975dffe490607564c16ad884423b903ab08a537 -// Grid source: engine/strata/third_party/ggml/ggml-common.h SHA256 0061131b615c5721fc88a78feeb22c1f8c450f1c2646a317d80796a653bf595c +// Native source: Strata 41cf05a0, src/kernels/cuda/iq_kernels.cu SHA256 07fe5567a7fc75a079dcc7887975dffe490607564c16ad884423b903ab08a537 +// Grid source: Strata 41cf05a0, third_party/ggml/ggml-common.h SHA256 0061131b615c5721fc88a78feeb22c1f8c450f1c2646a317d80796a653bf595c // Full MIT notice is retained in crates/quant-core/LICENSE-GGML. // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/crates/cuda-driver/src/moe_group_iq3_s.ptx b/crates/cuda-driver/src/moe_group_iq3_s.ptx index c27b3826..e36a6502 100644 --- a/crates/cuda-driver/src/moe_group_iq3_s.ptx +++ b/crates/cuda-driver/src/moe_group_iq3_s.ptx @@ -1,7 +1,7 @@ // IQ3_S Q8_1 routed projection; derived from llama.cpp/ggml native Fmt21. // Copyright (c) 2023-2026 The ggml authors. MIT License. -// Native source: engine/strata/src/kernels/cuda/iq_kernels.cu SHA256 07fe5567a7fc75a079dcc7887975dffe490607564c16ad884423b903ab08a537 -// Grid source: engine/strata/third_party/ggml/ggml-common.h SHA256 0061131b615c5721fc88a78feeb22c1f8c450f1c2646a317d80796a653bf595c +// Native source: Strata 41cf05a0, src/kernels/cuda/iq_kernels.cu SHA256 07fe5567a7fc75a079dcc7887975dffe490607564c16ad884423b903ab08a537 +// Grid source: Strata 41cf05a0, third_party/ggml/ggml-common.h SHA256 0061131b615c5721fc88a78feeb22c1f8c450f1c2646a317d80796a653bf595c // Full MIT notice is retained in crates/quant-core/LICENSE-GGML. // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/crates/cuda-driver/src/moe_group_iq3_s_nc4.ptx b/crates/cuda-driver/src/moe_group_iq3_s_nc4.ptx index 4cb7d856..dfecc878 100644 --- a/crates/cuda-driver/src/moe_group_iq3_s_nc4.ptx +++ b/crates/cuda-driver/src/moe_group_iq3_s_nc4.ptx @@ -5,8 +5,8 @@ // Tail activation loads clamp to last genuine pointer; only live stores write. // IQ3_S Q8_1 routed projection; derived from llama.cpp/ggml native Fmt21. // Copyright (c) 2023-2026 The ggml authors. MIT License. -// Native source: engine/strata/src/kernels/cuda/iq_kernels.cu SHA256 07fe5567a7fc75a079dcc7887975dffe490607564c16ad884423b903ab08a537 -// Grid source: engine/strata/third_party/ggml/ggml-common.h SHA256 0061131b615c5721fc88a78feeb22c1f8c450f1c2646a317d80796a653bf595c +// Native source: Strata 41cf05a0, src/kernels/cuda/iq_kernels.cu SHA256 07fe5567a7fc75a079dcc7887975dffe490607564c16ad884423b903ab08a537 +// Grid source: Strata 41cf05a0, third_party/ggml/ggml-common.h SHA256 0061131b615c5721fc88a78feeb22c1f8c450f1c2646a317d80796a653bf595c // Full MIT notice is retained in crates/quant-core/LICENSE-GGML. // // Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/crates/cuda-driver/src/qwen_ffi/bf16_receipt_types.rs b/crates/cuda-driver/src/qwen_ffi/bf16_receipt_types.rs index 454cb4cd..79e869e3 100644 --- a/crates/cuda-driver/src/qwen_ffi/bf16_receipt_types.rs +++ b/crates/cuda-driver/src/qwen_ffi/bf16_receipt_types.rs @@ -7,12 +7,12 @@ use super::{Asset, H, HC, N, Operation, Receipt, gdn_asset, gr_asset, moe_asset, pub(super) const BF16_RECEIPT: Receipt = Receipt { version: 1, source_sha256: [ - 0xd2, 0xab, 0x43, 0xbd, 0x68, 0x1d, 0x2e, 0x63, 0x41, 0x72, 0xd8, 0xcc, 0x9b, 0xff, 0x87, 0xfb, 0x82, 0xe8, - 0x06, 0x7c, 0x8e, 0x23, 0x2f, 0xf7, 0x8b, 0xf9, 0x61, 0xb0, 0x0d, 0x6d, 0x84, 0x53, + 0xcb, 0xdb, 0x14, 0xbd, 0x51, 0xde, 0xa7, 0x8b, 0x86, 0x7d, 0x12, 0x87, 0xaa, 0x8d, 0x95, 0x17, 0x45, 0xfc, + 0x37, 0xa3, 0xb1, 0x5f, 0xf9, 0xa1, 0x26, 0x83, 0xab, 0xff, 0xb4, 0xa9, 0x66, 0x6a, ], ptx_sha256: [ - 0x04, 0x45, 0x43, 0xf6, 0x81, 0xbb, 0x23, 0xeb, 0x9c, 0xae, 0x60, 0x2b, 0x1a, 0x16, 0xaa, 0x7b, 0x23, 0x86, - 0xd6, 0xd5, 0xc3, 0xb1, 0x5c, 0xc4, 0x19, 0x87, 0x33, 0x8b, 0xd6, 0x13, 0xb1, 0xc3, + 0x8b, 0x0d, 0x71, 0xf3, 0x43, 0xf2, 0xb2, 0xb3, 0x4b, 0x0e, 0x74, 0x2e, 0x3b, 0xb0, 0x8c, 0x21, 0x92, 0xbe, + 0x33, 0xe8, 0x01, 0x6c, 0x21, 0x36, 0xe6, 0x3f, 0xc7, 0xf3, 0x4f, 0x47, 0x7a, 0xaa, ], oracle_sha256: [ 0x70, 0xb4, 0x47, 0x95, 0x52, 0x8f, 0xb7, 0x3d, 0x63, 0x6b, 0xe5, 0x91, 0x4d, 0x60, 0xf0, 0xad, 0xaa, 0x84, diff --git a/crates/cuda-driver/src/sm86_table.rs b/crates/cuda-driver/src/sm86_table.rs index c83efd74..570f74e6 100644 --- a/crates/cuda-driver/src/sm86_table.rs +++ b/crates/cuda-driver/src/sm86_table.rs @@ -58,7 +58,7 @@ mod tests { /// SHA-256 over the per-row digests of (name NUL, key, len as u64 LE, sha, ptx) in table order: the value computed /// from the single 934-line table that this layout replaced. - const FORMER_TABLE_DIGEST: &str = "803b3cb0fd174a73d78bb727989f0c08066b3d052b647c052cc26bd6e84de3fc"; + const FORMER_TABLE_DIGEST: &str = "c06e99e69866d603498f5e3792dbee45917e4dd80ff93153b592ce9ed5e8b30c"; fn hex(bytes: &[u8]) -> String { bytes.iter().map(|b| format!("{b:02x}")).collect() diff --git a/crates/cuda-driver/src/sm86_table/companion_rows_highest_keys.rs b/crates/cuda-driver/src/sm86_table/companion_rows_highest_keys.rs index 0ff8ac3b..5a00a700 100644 --- a/crates/cuda-driver/src/sm86_table/companion_rows_highest_keys.rs +++ b/crates/cuda-driver/src/sm86_table/companion_rows_highest_keys.rs @@ -4,19 +4,6 @@ use super::Companion; /// Sorted by `key`; concatenated with the other parts by `super::COMPANIONS`. #[rustfmt::skip] pub(super) const ROWS: &[Companion] = &[ - Companion { - name: "original_verify.ptx", - key: [ - 0xd0, 0xda, 0xda, 0x67, 0x15, 0xfb, 0x80, 0x8b, 0xb3, 0x28, 0x82, 0x91, 0xfd, 0x4a, 0x5c, 0x29, - 0xe7, 0x8f, 0xd7, 0xfa, 0x6e, 0x70, 0xf2, 0xb9, 0x4d, 0x22, 0x0f, 0x86, 0x0b, 0xb4, 0x33, 0x53, - ], - len: 154200, - sha: [ - 0xba, 0x92, 0xfe, 0x4e, 0x9b, 0x5a, 0xe0, 0x48, 0x86, 0x4a, 0x1c, 0xcb, 0xa8, 0x64, 0x50, 0x22, - 0x4a, 0x07, 0x83, 0x67, 0x2c, 0x0c, 0x2b, 0x99, 0xe4, 0xec, 0x32, 0x02, 0xe1, 0x66, 0x03, 0x55, - ], - ptx: concat!(include_str!("../../ptx-sm86/original_verify.ptx"), "\0").as_bytes(), - }, Companion { name: "mtp_original_full_quant80.ptx", key: [ @@ -186,6 +173,19 @@ pub(super) const ROWS: &[Companion] = &[ ], ptx: concat!(include_str!("../../ptx-sm86/qsa_late.ptx"), "\0").as_bytes(), }, + Companion { + name: "iq3_s_q8_1.ptx", + key: [ + 0xeb, 0xfc, 0xab, 0xd4, 0x56, 0xb8, 0xcf, 0x16, 0x60, 0x8c, 0x52, 0x9b, 0x90, 0x68, 0x49, 0xe4, + 0x39, 0x10, 0x96, 0x32, 0x2a, 0x88, 0xe5, 0xa6, 0x65, 0xac, 0x87, 0x65, 0x7a, 0x91, 0xdd, 0xe6, + ], + len: 24718, + sha: [ + 0x46, 0xa6, 0x4e, 0x15, 0x1b, 0xbd, 0xfe, 0x0e, 0x5b, 0x3a, 0x4b, 0x36, 0xe6, 0xab, 0xab, 0x39, + 0x6a, 0xee, 0xd0, 0x26, 0x87, 0x2b, 0x60, 0x8e, 0x76, 0xb9, 0xa4, 0x82, 0xbe, 0xa8, 0x24, 0x0a, + ], + ptx: concat!(include_str!("../../ptx-sm86/iq3_s_q8_1.ptx"), "\0").as_bytes(), + }, Companion { name: "kar_decode_levels.ptx", key: [ diff --git a/crates/cuda-driver/src/sm86_table/companion_rows_lower_keys.rs b/crates/cuda-driver/src/sm86_table/companion_rows_lower_keys.rs index d3d42016..ddd29883 100644 --- a/crates/cuda-driver/src/sm86_table/companion_rows_lower_keys.rs +++ b/crates/cuda-driver/src/sm86_table/companion_rows_lower_keys.rs @@ -4,19 +4,6 @@ use super::Companion; /// Sorted by `key`; concatenated with the other parts by `super::COMPANIONS`. #[rustfmt::skip] pub(super) const ROWS: &[Companion] = &[ - Companion { - name: "mtp_original_prefill_fixup.ptx", - key: [ - 0x29, 0xfd, 0x3f, 0x75, 0x98, 0x64, 0x39, 0x75, 0x7c, 0x3a, 0x6e, 0xb1, 0x7d, 0x93, 0xe3, 0xed, - 0x12, 0x4c, 0xc4, 0x18, 0x51, 0x97, 0xa2, 0xb4, 0x45, 0x84, 0x10, 0xd1, 0xe7, 0xf7, 0xec, 0x4b, - ], - len: 325813, - sha: [ - 0x43, 0xa2, 0xa5, 0x24, 0x43, 0xcf, 0x7a, 0x2e, 0x2e, 0xe6, 0x58, 0xf5, 0x93, 0xb0, 0xfe, 0xb3, - 0x93, 0x3d, 0xb7, 0x37, 0x93, 0x69, 0xef, 0x19, 0x15, 0xfe, 0x23, 0x99, 0x6a, 0xca, 0xda, 0x84, - ], - ptx: concat!(include_str!("../../ptx-sm86/mtp_original_prefill_fixup.ptx"), "\0").as_bytes(), - }, Companion { name: "iq4_xs_q8_1.ptx", key: [ @@ -186,6 +173,19 @@ pub(super) const ROWS: &[Companion] = &[ ], ptx: concat!(include_str!("../../ptx-sm86/q6_k_q8_1.ptx"), "\0").as_bytes(), }, + Companion { + name: "moe_group_iq3_s.ptx", + key: [ + 0x46, 0xb0, 0xd5, 0x36, 0x5a, 0x15, 0x29, 0xc6, 0x5f, 0x47, 0x8a, 0xa5, 0x33, 0x50, 0x89, 0xe5, + 0x6e, 0xb6, 0x24, 0x37, 0x0f, 0x9c, 0x17, 0xc8, 0x7e, 0x79, 0xb7, 0x36, 0x9f, 0x0e, 0x7b, 0x8a, + ], + len: 25120, + sha: [ + 0x0e, 0x5e, 0x04, 0x34, 0x42, 0x10, 0x77, 0x51, 0x62, 0x13, 0x07, 0x9c, 0x02, 0xd9, 0xf9, 0x8f, + 0xf4, 0xbc, 0xfa, 0x46, 0x34, 0x79, 0x03, 0x78, 0x6e, 0x1d, 0xec, 0xd5, 0x20, 0xbb, 0xfd, 0x14, + ], + ptx: concat!(include_str!("../../ptx-sm86/moe_group_iq3_s.ptx"), "\0").as_bytes(), + }, Companion { name: "moe_route_top10.ptx", key: [ @@ -277,19 +277,6 @@ pub(super) const ROWS: &[Companion] = &[ ], ptx: concat!(include_str!("../../ptx-sm86/device_poison.ptx"), "\0").as_bytes(), }, - Companion { - name: "moe_group_iq3_s.ptx", - key: [ - 0x58, 0xd0, 0x68, 0xff, 0x3a, 0xcc, 0x42, 0x11, 0x61, 0x4f, 0x70, 0xab, 0x04, 0x70, 0x3a, 0x40, - 0x85, 0x8e, 0x14, 0x8f, 0x9a, 0xef, 0x85, 0x03, 0xed, 0x66, 0xf7, 0x64, 0x0a, 0xe2, 0xe2, 0xaa, - ], - len: 25114, - sha: [ - 0x36, 0xc2, 0xf6, 0x8c, 0x0d, 0x3a, 0x3c, 0x52, 0x47, 0x87, 0xec, 0xf0, 0x3a, 0x1f, 0x33, 0xe2, - 0xda, 0x93, 0x0a, 0x49, 0x17, 0x41, 0x9e, 0xa5, 0x89, 0x3c, 0xca, 0xa2, 0x8c, 0x33, 0xa8, 0x8c, - ], - ptx: concat!(include_str!("../../ptx-sm86/moe_group_iq3_s.ptx"), "\0").as_bytes(), - }, Companion { name: "original_sampler.ptx", key: [ @@ -355,4 +342,17 @@ pub(super) const ROWS: &[Companion] = &[ ], ptx: concat!(include_str!("../../ptx-sm86/ple_value_full_fixed.ptx"), "\0").as_bytes(), }, + Companion { + name: "q5_k_q8_1.ptx", + key: [ + 0x65, 0xcd, 0x98, 0x13, 0x8e, 0x2a, 0xd9, 0xd1, 0xc2, 0x71, 0x1f, 0xf7, 0xfc, 0x27, 0x28, 0x0f, + 0x07, 0xf1, 0xa2, 0x24, 0xfc, 0xdd, 0x2a, 0xbe, 0xea, 0x9b, 0xed, 0xf9, 0xd9, 0xd3, 0xff, 0xfc, + ], + len: 33608, + sha: [ + 0x24, 0x64, 0xea, 0x04, 0x0f, 0xfa, 0x4d, 0xa2, 0x03, 0xe7, 0xde, 0xe9, 0x14, 0x5a, 0x1e, 0xa9, + 0x88, 0xdb, 0x90, 0x2d, 0xff, 0xe7, 0xa1, 0x6d, 0x4f, 0x2c, 0xf1, 0x77, 0xcd, 0x7d, 0x32, 0xd6, + ], + ptx: concat!(include_str!("../../ptx-sm86/q5_k_q8_1.ptx"), "\0").as_bytes(), + }, ]; diff --git a/crates/cuda-driver/src/sm86_table/companion_rows_lowest_keys.rs b/crates/cuda-driver/src/sm86_table/companion_rows_lowest_keys.rs index d0688641..f8efd8c8 100644 --- a/crates/cuda-driver/src/sm86_table/companion_rows_lowest_keys.rs +++ b/crates/cuda-driver/src/sm86_table/companion_rows_lowest_keys.rs @@ -43,19 +43,6 @@ pub(super) const ROWS: &[Companion] = &[ ], ptx: concat!(include_str!("../../ptx-sm86/kar_ple_fixed.ptx"), "\0").as_bytes(), }, - Companion { - name: "bf16_f32_mmvf.ptx", - key: [ - 0x04, 0x45, 0x43, 0xf6, 0x81, 0xbb, 0x23, 0xeb, 0x9c, 0xae, 0x60, 0x2b, 0x1a, 0x16, 0xaa, 0x7b, - 0x23, 0x86, 0xd6, 0xd5, 0xc3, 0xb1, 0x5c, 0xc4, 0x19, 0x87, 0x33, 0x8b, 0xd6, 0x13, 0xb1, 0xc3, - ], - len: 5875, - sha: [ - 0x54, 0xa3, 0x31, 0x46, 0x55, 0x8e, 0xf7, 0x6c, 0x81, 0x7f, 0xc8, 0xe5, 0x56, 0xf7, 0x09, 0x22, - 0x8f, 0x90, 0xe2, 0xcc, 0xd6, 0x56, 0x5f, 0x57, 0xc4, 0xf8, 0xec, 0x46, 0x46, 0xe6, 0xc4, 0x42, - ], - ptx: concat!(include_str!("../../ptx-sm86/bf16_f32_mmvf.ptx"), "\0").as_bytes(), - }, Companion { name: "moe_group_iq4_xs_nc4.ptx", key: [ @@ -355,4 +342,17 @@ pub(super) const ROWS: &[Companion] = &[ ], ptx: concat!(include_str!("../../ptx-sm86/mmq-original-formats.ptx"), "\0").as_bytes(), }, + Companion { + name: "mtp_original_prefill_fixup.ptx", + key: [ + 0x29, 0xfd, 0x3f, 0x75, 0x98, 0x64, 0x39, 0x75, 0x7c, 0x3a, 0x6e, 0xb1, 0x7d, 0x93, 0xe3, 0xed, + 0x12, 0x4c, 0xc4, 0x18, 0x51, 0x97, 0xa2, 0xb4, 0x45, 0x84, 0x10, 0xd1, 0xe7, 0xf7, 0xec, 0x4b, + ], + len: 325813, + sha: [ + 0x43, 0xa2, 0xa5, 0x24, 0x43, 0xcf, 0x7a, 0x2e, 0x2e, 0xe6, 0x58, 0xf5, 0x93, 0xb0, 0xfe, 0xb3, + 0x93, 0x3d, 0xb7, 0x37, 0x93, 0x69, 0xef, 0x19, 0x15, 0xfe, 0x23, 0x99, 0x6a, 0xca, 0xda, 0x84, + ], + ptx: concat!(include_str!("../../ptx-sm86/mtp_original_prefill_fixup.ptx"), "\0").as_bytes(), + }, ]; diff --git a/crates/cuda-driver/src/sm86_table/companion_rows_middle_keys.rs b/crates/cuda-driver/src/sm86_table/companion_rows_middle_keys.rs index f0b1820d..051b112e 100644 --- a/crates/cuda-driver/src/sm86_table/companion_rows_middle_keys.rs +++ b/crates/cuda-driver/src/sm86_table/companion_rows_middle_keys.rs @@ -4,19 +4,6 @@ use super::Companion; /// Sorted by `key`; concatenated with the other parts by `super::COMPANIONS`. #[rustfmt::skip] pub(super) const ROWS: &[Companion] = &[ - Companion { - name: "q5_k_q8_1.ptx", - key: [ - 0x65, 0xcd, 0x98, 0x13, 0x8e, 0x2a, 0xd9, 0xd1, 0xc2, 0x71, 0x1f, 0xf7, 0xfc, 0x27, 0x28, 0x0f, - 0x07, 0xf1, 0xa2, 0x24, 0xfc, 0xdd, 0x2a, 0xbe, 0xea, 0x9b, 0xed, 0xf9, 0xd9, 0xd3, 0xff, 0xfc, - ], - len: 33608, - sha: [ - 0x24, 0x64, 0xea, 0x04, 0x0f, 0xfa, 0x4d, 0xa2, 0x03, 0xe7, 0xde, 0xe9, 0x14, 0x5a, 0x1e, 0xa9, - 0x88, 0xdb, 0x90, 0x2d, 0xff, 0xe7, 0xa1, 0x6d, 0x4f, 0x2c, 0xf1, 0x77, 0xcd, 0x7d, 0x32, 0xd6, - ], - ptx: concat!(include_str!("../../ptx-sm86/q5_k_q8_1.ptx"), "\0").as_bytes(), - }, Companion { name: "native_head_iq.ptx", key: [ @@ -134,6 +121,19 @@ pub(super) const ROWS: &[Companion] = &[ ], ptx: concat!(include_str!("../../ptx-sm86/head_greedy.ptx"), "\0").as_bytes(), }, + Companion { + name: "moe_group_iq3_s_nc4.ptx", + key: [ + 0x7a, 0x13, 0x91, 0x1f, 0x99, 0x8d, 0x38, 0xbb, 0xa5, 0xc5, 0x28, 0x62, 0xf9, 0x27, 0x99, 0xd1, + 0x7a, 0x66, 0x2e, 0x84, 0x27, 0xc1, 0xcd, 0xff, 0x24, 0xf0, 0x1c, 0x1f, 0x30, 0xa7, 0xfd, 0x94, + ], + len: 36388, + sha: [ + 0xe1, 0x2d, 0xea, 0x8f, 0x92, 0x1e, 0xfd, 0x99, 0xc9, 0x48, 0x30, 0x12, 0xf8, 0xda, 0x00, 0xc5, + 0xba, 0x1b, 0xa6, 0x6b, 0x04, 0x44, 0xff, 0x4b, 0xa9, 0x8f, 0xed, 0x49, 0x03, 0xed, 0x51, 0xe5, + ], + ptx: concat!(include_str!("../../ptx-sm86/moe_group_iq3_s_nc4.ptx"), "\0").as_bytes(), + }, Companion { name: "mtp_gr_fixed.ptx", key: [ @@ -290,6 +290,19 @@ pub(super) const ROWS: &[Companion] = &[ ], ptx: concat!(include_str!("../../ptx-sm86/qsa_prompt_indexer.ptx"), "\0").as_bytes(), }, + Companion { + name: "bf16_f32_mmvf.ptx", + key: [ + 0x8b, 0x0d, 0x71, 0xf3, 0x43, 0xf2, 0xb2, 0xb3, 0x4b, 0x0e, 0x74, 0x2e, 0x3b, 0xb0, 0x8c, 0x21, + 0x92, 0xbe, 0x33, 0xe8, 0x01, 0x6c, 0x21, 0x36, 0xe6, 0x3f, 0xc7, 0xf3, 0x4f, 0x47, 0x7a, 0xaa, + ], + len: 5878, + sha: [ + 0x29, 0xe6, 0xa2, 0x66, 0xd9, 0x60, 0x8d, 0xf5, 0xff, 0x00, 0xc8, 0x7c, 0xa8, 0x29, 0x6c, 0x55, + 0xf4, 0xea, 0x53, 0xed, 0x4d, 0x1f, 0xe0, 0x1f, 0x0b, 0x78, 0x5b, 0x76, 0x98, 0x4d, 0x43, 0x18, + ], + ptx: concat!(include_str!("../../ptx-sm86/bf16_f32_mmvf.ptx"), "\0").as_bytes(), + }, Companion { name: "qsa_prompt_resolver.ptx", key: [ @@ -342,17 +355,4 @@ pub(super) const ROWS: &[Companion] = &[ ], ptx: concat!(include_str!("../../ptx-sm86/qsa_prompt_attention_variants.ptx"), "\0").as_bytes(), }, - Companion { - name: "qwen_qsa_attention.ptx", - key: [ - 0x91, 0x21, 0x9c, 0xfb, 0xc1, 0xa7, 0x7c, 0x4b, 0xb6, 0x66, 0x61, 0x06, 0x0a, 0xc9, 0x39, 0xa5, - 0x0d, 0xc4, 0xc4, 0xd7, 0xd4, 0xdb, 0x8d, 0x50, 0xbc, 0x59, 0xfb, 0xcd, 0x16, 0x75, 0x62, 0xb2, - ], - len: 26737, - sha: [ - 0xc1, 0x11, 0xc6, 0x12, 0x6a, 0x3a, 0x67, 0x5e, 0xc8, 0x87, 0x20, 0x88, 0x1d, 0x46, 0x99, 0xa6, - 0xe7, 0x21, 0x84, 0xd2, 0xf4, 0x55, 0x87, 0x9a, 0xe0, 0x85, 0x5c, 0x56, 0xb8, 0x48, 0xbe, 0xa1, - ], - ptx: concat!(include_str!("../../ptx-sm86/qwen_qsa_attention.ptx"), "\0").as_bytes(), - }, ]; diff --git a/crates/cuda-driver/src/sm86_table/companion_rows_upper_keys.rs b/crates/cuda-driver/src/sm86_table/companion_rows_upper_keys.rs index 8a6936a9..f58fda57 100644 --- a/crates/cuda-driver/src/sm86_table/companion_rows_upper_keys.rs +++ b/crates/cuda-driver/src/sm86_table/companion_rows_upper_keys.rs @@ -4,6 +4,19 @@ use super::Companion; /// Sorted by `key`; concatenated with the other parts by `super::COMPANIONS`. #[rustfmt::skip] pub(super) const ROWS: &[Companion] = &[ + Companion { + name: "qwen_qsa_attention.ptx", + key: [ + 0x91, 0x21, 0x9c, 0xfb, 0xc1, 0xa7, 0x7c, 0x4b, 0xb6, 0x66, 0x61, 0x06, 0x0a, 0xc9, 0x39, 0xa5, + 0x0d, 0xc4, 0xc4, 0xd7, 0xd4, 0xdb, 0x8d, 0x50, 0xbc, 0x59, 0xfb, 0xcd, 0x16, 0x75, 0x62, 0xb2, + ], + len: 26737, + sha: [ + 0xc1, 0x11, 0xc6, 0x12, 0x6a, 0x3a, 0x67, 0x5e, 0xc8, 0x87, 0x20, 0x88, 0x1d, 0x46, 0x99, 0xa6, + 0xe7, 0x21, 0x84, 0xd2, 0xf4, 0x55, 0x87, 0x9a, 0xe0, 0x85, 0x5c, 0x56, 0xb8, 0x48, 0xbe, 0xa1, + ], + ptx: concat!(include_str!("../../ptx-sm86/qwen_qsa_attention.ptx"), "\0").as_bytes(), + }, Companion { name: "moe_group_down_q2_0.ptx", key: [ @@ -17,19 +30,6 @@ pub(super) const ROWS: &[Companion] = &[ ], ptx: concat!(include_str!("../../ptx-sm86/moe_group_down_q2_0.ptx"), "\0").as_bytes(), }, - Companion { - name: "iq3_s_q8_1.ptx", - key: [ - 0x94, 0xf7, 0x98, 0xc0, 0x08, 0x13, 0xc2, 0xfb, 0x86, 0x0b, 0x4b, 0xf7, 0x7b, 0xe9, 0x22, 0x57, - 0x67, 0xd4, 0x08, 0x95, 0x5e, 0x34, 0x21, 0x33, 0x0a, 0xc3, 0x4a, 0x4e, 0xbd, 0x43, 0x97, 0x8f, - ], - len: 24712, - sha: [ - 0xb1, 0x98, 0x60, 0x07, 0x0e, 0x69, 0xdc, 0xcd, 0x5e, 0x98, 0xd1, 0xe6, 0xbc, 0x7c, 0xdd, 0xcd, - 0xa2, 0x92, 0x8e, 0xfb, 0xd3, 0xf0, 0xbd, 0x21, 0x56, 0x8f, 0xd1, 0xae, 0x7d, 0x4a, 0xe9, 0x27, - ], - ptx: concat!(include_str!("../../ptx-sm86/iq3_s_q8_1.ptx"), "\0").as_bytes(), - }, Companion { name: "mtp_original_full_gr_post.ptx", key: [ @@ -290,19 +290,6 @@ pub(super) const ROWS: &[Companion] = &[ ], ptx: concat!(include_str!("../../ptx-sm86/mtp_original_full_router.ptx"), "\0").as_bytes(), }, - Companion { - name: "moe_group_iq3_s_nc4.ptx", - key: [ - 0xbe, 0x6e, 0xe9, 0x07, 0xc0, 0xb3, 0x70, 0xcb, 0x99, 0x89, 0x4a, 0x03, 0x41, 0x94, 0x66, 0xf1, - 0xaa, 0x46, 0x5b, 0xa9, 0xb8, 0xe2, 0xe8, 0xcf, 0x60, 0x38, 0x87, 0xf5, 0x34, 0x45, 0x0d, 0x0c, - ], - len: 36382, - sha: [ - 0x23, 0xb7, 0x02, 0xaa, 0xf1, 0x27, 0x8d, 0xd3, 0xd4, 0x36, 0x14, 0x2b, 0x9c, 0x27, 0x32, 0x19, - 0x21, 0xf3, 0x6d, 0xda, 0x76, 0x06, 0xd1, 0xf7, 0x56, 0x97, 0x3e, 0x5d, 0xfc, 0xbd, 0x45, 0x37, - ], - ptx: concat!(include_str!("../../ptx-sm86/moe_group_iq3_s_nc4.ptx"), "\0").as_bytes(), - }, Companion { name: "mtp_original_full_verify.ptx", key: [ @@ -355,4 +342,17 @@ pub(super) const ROWS: &[Companion] = &[ ], ptx: concat!(include_str!("../../ptx-sm86/original_verify_window_pcie.ptx"), "\0").as_bytes(), }, + Companion { + name: "original_verify.ptx", + key: [ + 0xd0, 0xda, 0xda, 0x67, 0x15, 0xfb, 0x80, 0x8b, 0xb3, 0x28, 0x82, 0x91, 0xfd, 0x4a, 0x5c, 0x29, + 0xe7, 0x8f, 0xd7, 0xfa, 0x6e, 0x70, 0xf2, 0xb9, 0x4d, 0x22, 0x0f, 0x86, 0x0b, 0xb4, 0x33, 0x53, + ], + len: 154200, + sha: [ + 0xba, 0x92, 0xfe, 0x4e, 0x9b, 0x5a, 0xe0, 0x48, 0x86, 0x4a, 0x1c, 0xcb, 0xa8, 0x64, 0x50, 0x22, + 0x4a, 0x07, 0x83, 0x67, 0x2c, 0x0c, 0x2b, 0x99, 0xe4, 0xec, 0x32, 0x02, 0xe1, 0x66, 0x03, 0x55, + ], + ptx: concat!(include_str!("../../ptx-sm86/original_verify.ptx"), "\0").as_bytes(), + }, ]; diff --git a/scripts/test-cuda-projection-family-driver.sh b/scripts/test-cuda-projection-family-driver.sh index a44b5437..622612ed 100755 --- a/scripts/test-cuda-projection-family-driver.sh +++ b/scripts/test-cuda-projection-family-driver.sh @@ -15,7 +15,7 @@ cc -std=c11 -Wall -Wextra -Werror -Wno-misleading-indentation -ffp-contract=off sha256sum "$work/family/libcuda.so.1" echo '341abbd0113919d573241b1dc47886514ea7aa1d4d3f1a867024e7664b501a0a crates/cuda-driver/src/q8_0_q8_1.ptx' | sha256sum --check echo '294f3ad5fdddf796941346c9144fc49d4cff5478a88daad6b8941fbd4bb240cb crates/cuda-driver/src/q4_k_q8_1.ptx' | sha256sum --check -echo '94f798c00813c2fb860b4bf77be9225767d408955e3421330ac34a4ebd43978f crates/cuda-driver/src/iq3_s_q8_1.ptx' | sha256sum --check +echo 'ebfcabd456b8cf16608c529b906849e4391096322a88e5a665ac87657a91dde6 crates/cuda-driver/src/iq3_s_q8_1.ptx' | sha256sum --check echo 'f9c10814f37b75babcaee1028b4a1375e530220f863ab3801beb8fcb5a19733f crates/cuda-driver/src/iq3_xxs_q8_1.ptx' | sha256sum --check echo 'a31e653da8c222e1671cf25ed19017eeb0b3ef4d890c0142b181f3d5bcfcfb2c crates/cuda-driver/src/iq2_s_q8_1.ptx' | sha256sum --check echo '189b02cee8186379fb7b0bd07a831e1fb2764d29a98a17fd2b516c5459f9d4ce crates/cuda-driver/src/iq4_nl_q8_1.ptx' | sha256sum --check