Skip to content

Commit 91d0f38

Browse files
committed
Address review feedback on fpA_intB tactic cache
- Reject cached CUDA-GEMV tactics when the runner has no GEMV kernel. - Overwrite cache rows rejected on load with the freshly profiled tactic. - Fail Flush when the advisory file lock cannot be acquired, instead of writing unlocked and risking lost rows. - Add has_bias to GemmIdCore and the persistent key/TSV schema, and bump tactic_selection_version. - Add the GPU name to GemmIdCore so the process-global profile map is not shared between devices that have the same packing SM. - Renumber the tactic cache doc section to 6.3 and fix its references.
1 parent 9aac11e commit 91d0f38

9 files changed

Lines changed: 132 additions & 38 deletions

File tree

‎docs/contrib_ops/cuda/gemm_profiler_cache.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ punctuation) that make CSV quoting fragile.
9999
```
100100
# ort_cuda_gemm_tactic_cache v1
101101
# table matmulnbits_fpa_intb
102-
# tactic_selection_version 1
102+
# tactic_selection_version 2
103103
# device_name NVIDIA A100-SXM4-80GB
104104
# sm 80
105105
# multiprocessor_count 108
@@ -108,9 +108,9 @@ punctuation) that make CSV quoting fragile.
108108
# ort_version 1.23.0
109109
# ort_git_commit <git-sha-or-unknown>
110110
# ort_build_config Release
111-
n_16b k activation_dtype weight_type bits block_size has_zero_points zero_point_dtype gemv_enabled packing_sm m_bucket valid_config sm_version tile80 tile90 tile100 tile120 split_k_style split_k stages cluster mainloop epilogue tma enable_cuda_kernel
112-
12288 4096 half uint4b_t 4 64 1 uint4b_t 1 80 1 1 80 23 0 0 0 0 1 1 3 0 0 0 0 1
113-
12288 4096 half uint4b_t 4 64 1 uint4b_t 1 80 64 1 80 17 0 0 0 0 0 -1 4 0 0 0 0 0
111+
n_16b k activation_dtype weight_type bits block_size has_zero_points zero_point_dtype gemv_enabled has_bias packing_sm m_bucket valid_config sm_version tile80 tile90 tile100 tile120 split_k_style split_k stages cluster mainloop epilogue tma enable_cuda_kernel
112+
12288 4096 half uint4b_t 4 64 1 uint4b_t 1 0 80 1 1 80 23 0 0 0 0 1 1 3 0 0 0 0 1
113+
12288 4096 half uint4b_t 4 64 1 uint4b_t 1 0 80 64 1 80 17 0 0 0 0 0 -1 4 0 0 0 0 0
114114
...
115115
```
116116

@@ -119,7 +119,7 @@ n_16b k activation_dtype weight_type bits block_size has_zero_points zero_point_
119119
```
120120
# ort_cuda_gemm_tactic_cache v1
121121
# table qmoe_gemm
122-
# tactic_selection_version 1
122+
# tactic_selection_version 2
123123
# device_name NVIDIA A100-SXM4-80GB
124124
# sm 80
125125
# multiprocessor_count 108
@@ -179,7 +179,7 @@ Use op-specific keys rather than a single sparse superset.
179179
```
180180
matmulnbits_key = {
181181
n_16b, k, activation_dtype, weight_type, bits, block_size,
182-
has_zero_points, zero_point_dtype, gemv_enabled, packing_sm
182+
has_zero_points, zero_point_dtype, gemv_enabled, has_bias, packing_sm
183183
}
184184
185185
qmoe_key = {
@@ -236,7 +236,7 @@ unit-testable.
236236
- *Strategy*: Wire the `gemm_tactic_cache` utility independently into `GemmPluginProfiler` and `MoeGemmProfiler` rather than attempting a large refactor. The shared cache utility provides a simple `GetConfig(...)` / `PutConfig(...)` API.
237237
- `gemm_profiler.h`: before the M sweep in `profileTactics`, load matching entries and skip if hit;
238238
after profiling, merge into the disk cache. Re-enable the serialize stubs.
239-
- `matmul_nbits.{h,cc}`: pass `bits / block_size / zero-point mode / gemv_enabled / packing_sm`
239+
- `matmul_nbits.{h,cc}`: pass `bits / block_size / zero-point mode / gemv_enabled / has_bias / packing_sm`
240240
into the MatMulNBits key.
241241
- `moe_quantization.cc` + `moe_gemm_profiler.{h,cc}`: use the same disk cache + key; QMoE gains
242242
cross-node dedup via the shared cache. Add a process-global MoE profiler manager

‎docs/contrib_ops/cuda/matmul_nbits.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ Prepacked weights are intentionally strict:
531531

532532
---
533533

534-
## 6.1 fpA_intB Tactic Autotune Cache
534+
### 6.3 fpA_intB Tactic Autotune Cache
535535

536536
The fpA_intB profiler (§6) tunes CUTLASS/CUDA tactics per problem shape. By
537537
default this is in-process only and re-run every session. When a cache location
@@ -658,9 +658,9 @@ present. `ComputeInternal` then:
658658
|----------|----------------|--------|
659659
| `ORT_DISABLE_QMOE_ROUTER_GEMV_SPECIALIZATION` | bool, `0` | Disable the router GEMV specialization (§4.3); shapes fall back to the generic GEMV / dequant path. Useful for A/B benchmarking. |
660660
| `ORT_FPA_INTB_GEMM` | int/string, `0` | Enable the CUTLASS weight-only path (§6). `0` or `off` disables it, otherwise enables it. |
661-
| `ORT_FPA_INTB_PROFILE_M` | comma list, unset | Override the M buckets profiled for the fpA_intB tactic cache (§6.1). The maximum value also bounds the initial profile range. Session-config equivalent: `ep.cuda.fpa_intb_profile_m`. |
662-
| `ORT_CUDA_GEMM_TACTIC_CACHE_DIR` | path, unset | Directory for the persistent fpA_intB tactic cache (§6.1). Unset means the cache is in-process only. Session-config equivalent: `ep.cuda.gemm_tactic_cache_dir`. |
663-
| `ORT_CUDA_GEMM_TACTIC_CACHE_PREFIX` | path prefix, unset | Explicit cache file prefix (§6.1); writes `<prefix>.matmulnbits_fpa_intb.tsv`. Session-config equivalent: `ep.cuda.gemm_tactic_cache_prefix`. |
661+
| `ORT_FPA_INTB_PROFILE_M` | comma list, unset | Override the M buckets profiled for the fpA_intB tactic cache (§6.3). The maximum value also bounds the initial profile range. Session-config equivalent: `ep.cuda.fpa_intb_profile_m`. |
662+
| `ORT_CUDA_GEMM_TACTIC_CACHE_DIR` | path, unset | Directory for the persistent fpA_intB tactic cache (§6.3). Unset means the cache is in-process only. Session-config equivalent: `ep.cuda.gemm_tactic_cache_dir`. |
663+
| `ORT_CUDA_GEMM_TACTIC_CACHE_PREFIX` | path prefix, unset | Explicit cache file prefix (§6.3); writes `<prefix>.matmulnbits_fpa_intb.tsv`. Session-config equivalent: `ep.cuda.gemm_tactic_cache_prefix`. |
664664
| `ORT_MATMULNBITS_FORCE_CHUNKED` | int, `0` | Force the chunked dequant+GEMM fallback (§5) regardless of the size heuristic, and bypass the fpA_intB M-chunking size condition (§6.2). |
665665
| `ORT_MATMULNBITS_CHUNK_SIZE` | int64, `32768` | Target rows per chunk in the chunked fallback. Values `< 1` reset to the default. |
666666
| `ORT_MATMULNBITS_M_CHUNK_SIZE` | int, `0` | Max rows of `A` per fpA_intB launch (§6.2). `0` disables M chunking. Overridden by the `ep.cuda.matmul_nbits_m_chunk_size` session config entry. Also applies to the CUDA plugin EP. |
@@ -730,7 +730,7 @@ present. `ComputeInternal` then:
730730
[onnxruntime/test/contrib_ops/matmul_2bits_test.cc](../../../onnxruntime/test/contrib_ops/matmul_2bits_test.cc).
731731
Run it from `onnxruntime_provider_test` with
732732
`--gtest_filter=MatMul2BitsCuda.*`.
733-
- fpA_intB tactic cache (§6.1) unit tests:
733+
- fpA_intB tactic cache (§6.3) unit tests:
734734
[onnxruntime/test/contrib_ops/cuda_kernels/gemm_tactic_cache_test.cc](../../../onnxruntime/test/contrib_ops/cuda_kernels/gemm_tactic_cache_test.cc)
735735
(config serialize/parse round-trip, signature-mismatch rejection, appended-column
736736
tolerance, store/load and merge). Build with `onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON`

‎onnxruntime/contrib_ops/cuda/llm/fpA_intB_gemm_profiler.cc‎

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@
3030
using namespace onnxruntime::llm::common;
3131
using namespace onnxruntime::llm::kernels::cutlass_kernels;
3232

33+
namespace {
34+
// Compares tactics by their persisted representation, which is exactly what a cache hit stores.
35+
bool SameConfigColumns(const std::optional<onnxruntime::llm::cutlass_extensions::CutlassGemmConfig>& a,
36+
const std::optional<onnxruntime::llm::cutlass_extensions::CutlassGemmConfig>& b) {
37+
std::vector<std::string> columns_a;
38+
std::vector<std::string> columns_b;
39+
onnxruntime::llm::gemm_cache::AppendConfigColumns(columns_a, a);
40+
onnxruntime::llm::gemm_cache::AppendConfigColumns(columns_b, b);
41+
return columns_a == columns_b;
42+
}
43+
} // namespace
44+
3345
namespace onnxruntime::llm::kernels::weight_only {
3446

3547
std::optional<size_t> ComputeWeightOnlyGemmProfilerScratchSize(
@@ -227,6 +239,7 @@ onnxruntime::llm::gemm_cache::MatMulNBitsKey WeightOnlyGroupwiseQuantGemmPluginP
227239
key.has_zero_points = mHasZeros;
228240
key.zero_point_dtype = mHasZeros ? key.weight_type : "none";
229241
key.gemv_enabled = hasWeightOnlyCudaKernel;
242+
key.has_bias = mHasBiases;
230243
key.packing_sm = mArch;
231244
return key;
232245
}
@@ -242,12 +255,12 @@ void WeightOnlyGroupwiseQuantGemmPluginProfiler::loadPersistentCache(
242255
return;
243256
}
244257

245-
// Validate CUTLASS tactics loaded from disk against the tactics this runner can actually
246-
// dispatch. A parseable-but-incompatible cache row (e.g. hand-edited, or written by a build
247-
// whose signature happens to match but whose tactic set differs) would otherwise be handed
248-
// straight to the kernel. Non-matching CUTLASS tactics are dropped so the bucket is re-profiled.
249-
// The synthetic CUDA-GEMV tactic (enableCudaKernel) is not part of getConfigs(); its validity
250-
// is already keyed by gemv_enabled in the cache key, so it is accepted as-is.
258+
// Validate tactics loaded from disk against the tactics this runner can actually dispatch. A
259+
// parseable-but-incompatible cache row (e.g. hand-edited, or written by a build whose signature
260+
// happens to match but whose tactic set differs) would otherwise be handed straight to the kernel.
261+
// Rejected rows are dropped so the bucket is re-profiled (and the stale row overwritten on staging).
262+
// The CUDA-GEMV tactic is only dispatchable when this runner has a GEMV kernel, so it is rejected
263+
// otherwise, regardless of what the row's key claims.
251264
auto const valid_configs = getTactics(0, gemmId.n, gemmId.k);
252265
auto is_valid_cutlass = [&valid_configs](Config const& c) {
253266
for (auto const& v : valid_configs) {
@@ -269,6 +282,10 @@ void WeightOnlyGroupwiseQuantGemmPluginProfiler::loadPersistentCache(
269282
ORT_LLM_LOG_WARNING("Dropping unsupported cached fpA_intB tactic from the tactic cache; re-profiling.");
270283
continue;
271284
}
285+
if (config->enableCudaKernel && !hasWeightOnlyCudaKernel) {
286+
ORT_LLM_LOG_WARNING("Dropping cached fpA_intB CUDA-GEMV tactic: no GEMV kernel is available; re-profiling.");
287+
continue;
288+
}
272289
if (!config->enableCudaKernel && !is_valid_cutlass(*config)) {
273290
ORT_LLM_LOG_WARNING("Dropping incompatible cached fpA_intB tactic from the tactic cache; re-profiling.");
274291
continue;
@@ -287,11 +304,14 @@ bool WeightOnlyGroupwiseQuantGemmPluginProfiler::stageProfiledTactics(
287304
auto key = makeCacheKey(gemmId, hasWeightOnlyCudaKernel);
288305
bool added = false;
289306
for (auto const& [m, config] : map) {
290-
// Only stage buckets that are not already recorded (skips re-staging cache hits).
291-
if (!mCache->Get(key, m).has_value()) {
292-
mCache->Put(key, m, config);
293-
added = true;
307+
// Skip buckets already recorded with the same tactic (cache hits). A row rejected on load is still
308+
// in the cache, so it must be overwritten by the freshly profiled tactic.
309+
auto const cached = mCache->Get(key, m);
310+
if (cached.has_value() && SameConfigColumns(*cached, config)) {
311+
continue;
294312
}
313+
mCache->Put(key, m, config);
314+
added = true;
295315
}
296316
return added;
297317
}

‎onnxruntime/contrib_ops/cuda/llm/gemm_profiler.h‎

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626
#include <optional>
2727
#include <shared_mutex>
2828
#include <sstream>
29+
#include <string>
2930
#include <unordered_map>
31+
#include <utility>
3032
#include <vector>
3133

3234
#include "contrib_ops/cuda/llm/nv_infer_datatype.h"
@@ -92,7 +94,9 @@ struct GemmDims {
9294
// In our case GEMM is uniquely identified by N and K, plus the target SM architecture (so the
9395
// SM80-compatibility and native SM90 kernels for the same shape do not share profiled configs).
9496
// The quantization fields keep the process-global profile map aligned with the persistent cache key:
95-
// kernels with different bits/group size/zero points/GEMV support must not share tactics.
97+
// kernels with different bits/group size/zero points/bias/GEMV support must not share tactics.
98+
// device_name separates GPUs that share a packing SM (e.g. RTX 4090 and RTX 4060) so a tactic profiled
99+
// on one device is never reused, or written to a disk cache, for another.
96100
class GemmIdCore {
97101
public:
98102
int n;
@@ -103,10 +107,13 @@ class GemmIdCore {
103107
int group_size;
104108
bool has_zeros;
105109
bool gemv_enabled;
110+
bool has_bias;
111+
std::string device_name;
106112

107113
GemmIdCore(int n_, int k_, nvinfer::DataType const& dtype_, int sm_ = 0, int bits_ = 0, int group_size_ = 0,
108-
bool has_zeros_ = false, bool gemv_enabled_ = false)
109-
: n(n_), k(k_), dtype(dtype_), sm(sm_), bits(bits_), group_size(group_size_), has_zeros(has_zeros_), gemv_enabled(gemv_enabled_) {
114+
bool has_zeros_ = false, bool gemv_enabled_ = false, bool has_bias_ = false,
115+
std::string device_name_ = std::string())
116+
: n(n_), k(k_), dtype(dtype_), sm(sm_), bits(bits_), group_size(group_size_), has_zeros(has_zeros_), gemv_enabled(gemv_enabled_), has_bias(has_bias_), device_name(std::move(device_name_)) {
110117
}
111118

112119
GemmIdCore()
@@ -115,7 +122,8 @@ class GemmIdCore {
115122
bits(0),
116123
group_size(0),
117124
has_zeros(false),
118-
gemv_enabled(false) {
125+
gemv_enabled(false),
126+
has_bias(false) {
119127
}
120128

121129
bool operator==(GemmIdCore const& id) const {
@@ -127,14 +135,16 @@ class GemmIdCore {
127135
out << " type=" << static_cast<int>(id.dtype);
128136
out << " sm=" << id.sm;
129137
out << " bits=" << id.bits << " group_size=" << id.group_size;
130-
out << " has_zeros=" << id.has_zeros << " gemv=" << id.gemv_enabled;
138+
out << " has_zeros=" << id.has_zeros << " gemv=" << id.gemv_enabled << " has_bias=" << id.has_bias;
139+
out << " device=" << id.device_name;
131140
return out;
132141
}
133142

134143
protected:
135144
bool isEqual(GemmIdCore const& id) const {
136145
return n == id.n && k == id.k && dtype == id.dtype && sm == id.sm && bits == id.bits &&
137-
group_size == id.group_size && has_zeros == id.has_zeros && gemv_enabled == id.gemv_enabled;
146+
group_size == id.group_size && has_zeros == id.has_zeros && gemv_enabled == id.gemv_enabled &&
147+
has_bias == id.has_bias && device_name == id.device_name;
138148
}
139149
};
140150

@@ -145,9 +155,10 @@ struct GemmIdCoreHash {
145155
auto h2 = std::hash<int>{}(id.k);
146156
auto h3 = std::hash<int>{}(static_cast<int>(id.dtype));
147157
auto h4 = std::hash<int>{}(id.sm);
148-
auto h5 = std::hash<int>{}((id.bits << 16) ^ (id.group_size << 2) ^ (id.has_zeros ? 2 : 0) ^
149-
(id.gemv_enabled ? 1 : 0));
150-
return h1 ^ h2 ^ h3 ^ h4 ^ h5;
158+
auto h5 = std::hash<int>{}((id.bits << 16) ^ (id.group_size << 3) ^ (id.has_bias ? 4 : 0) ^
159+
(id.has_zeros ? 2 : 0) ^ (id.gemv_enabled ? 1 : 0));
160+
auto h6 = std::hash<std::string>{}(id.device_name);
161+
return h1 ^ h2 ^ h3 ^ h4 ^ h5 ^ h6;
151162
}
152163
};
153164

‎onnxruntime/contrib_ops/cuda/llm/gemm_tactic_cache.cc‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ bool MatMulNBitsKey::operator==(const MatMulNBitsKey& o) const {
356356
activation_dtype == o.activation_dtype && weight_type == o.weight_type &&
357357
bits == o.bits && block_size == o.block_size &&
358358
has_zero_points == o.has_zero_points && zero_point_dtype == o.zero_point_dtype &&
359-
gemv_enabled == o.gemv_enabled && packing_sm == o.packing_sm;
359+
gemv_enabled == o.gemv_enabled && has_bias == o.has_bias && packing_sm == o.packing_sm;
360360
}
361361

362362
std::size_t MatMulNBitsKeyHash::operator()(const MatMulNBitsKey& k) const {
@@ -372,6 +372,7 @@ std::size_t MatMulNBitsKeyHash::operator()(const MatMulNBitsKey& k) const {
372372
mix(std::hash<bool>{}(k.has_zero_points));
373373
mix(std::hash<std::string>{}(k.zero_point_dtype));
374374
mix(std::hash<bool>{}(k.gemv_enabled));
375+
mix(std::hash<bool>{}(k.has_bias));
375376
mix(std::hash<int>{}(k.packing_sm));
376377
return h;
377378
}
@@ -382,7 +383,7 @@ namespace {
382383
const std::vector<std::string>& MatMulNBitsColumnNames() {
383384
static const std::vector<std::string> names = {
384385
"n_16b", "k", "activation_dtype", "weight_type", "bits",
385-
"block_size", "has_zero_points", "zero_point_dtype", "gemv_enabled", "packing_sm",
386+
"block_size", "has_zero_points", "zero_point_dtype", "gemv_enabled", "has_bias", "packing_sm",
386387
"m_bucket", "valid_config", "sm_version", "tile80", "tile90", "tile100", "tile120",
387388
"split_k_style", "split_k", "stages", "cluster", "mainloop", "epilogue", "tma",
388389
"enable_cuda_kernel"};
@@ -551,6 +552,9 @@ onnxruntime::common::Status MatMulNBitsTacticCache::Load() {
551552
int gemv = 0;
552553
ParseInt(field("gemv_enabled"), gemv);
553554
key.gemv_enabled = gemv != 0;
555+
int has_bias = 0;
556+
ParseInt(field("has_bias"), has_bias);
557+
key.has_bias = has_bias != 0;
554558

555559
int m_bucket = 0;
556560
if (!ParseInt(field("m_bucket"), m_bucket)) {
@@ -590,7 +594,7 @@ onnxruntime::common::Status MatMulNBitsTacticCache::Load() {
590594

591595
onnxruntime::common::Status MatMulNBitsTacticCache::WriteAllLocked(
592596
const std::unordered_map<MatMulNBitsKey, BucketMap, MatMulNBitsKeyHash>& table) const {
593-
// Unique per writer so concurrent writers never share a temp file, even if the file lock failed.
597+
// Unique per writer so concurrent writers never share a temp file.
594598
static std::atomic<uint64_t> tmp_counter{0};
595599
const std::string tmp_path = file_path_ + ".tmp." + std::to_string(CurrentProcessId()) + "." +
596600
std::to_string(tmp_counter.fetch_add(1));
@@ -633,6 +637,7 @@ onnxruntime::common::Status MatMulNBitsTacticCache::WriteAllLocked(
633637
row.emplace_back(key.has_zero_points ? "1" : "0");
634638
row.emplace_back(TsvEncode(key.zero_point_dtype));
635639
row.emplace_back(key.gemv_enabled ? "1" : "0");
640+
row.emplace_back(key.has_bias ? "1" : "0");
636641
row.emplace_back(std::to_string(key.packing_sm));
637642
row.emplace_back(std::to_string(m_bucket));
638643
AppendConfigColumns(row, cfg);
@@ -684,9 +689,12 @@ onnxruntime::common::Status MatMulNBitsTacticCache::Flush() {
684689
}
685690
}
686691

692+
// Without the lock two writers could load the same snapshot and the last rename would drop the
693+
// other's rows, so fail the flush (the rows stay dirty and are retried at the next flush point).
687694
ScopedFileLock lock(file_path_);
688-
// Even if the OS lock could not be acquired, proceed best-effort; atomic rename
689-
// still guarantees a consistent file, only lost updates become possible.
695+
if (!lock.locked()) {
696+
return ORT_MAKE_STATUS(ONNXRUNTIME, FAIL, "Failed to acquire the gemm tactic cache file lock: ", file_path_, ".lock");
697+
}
690698

691699
// Reload the current on-disk file so concurrently-written rows are not dropped,
692700
// then overlay the in-memory table (in-memory wins on conflict).

‎onnxruntime/contrib_ops/cuda/llm/gemm_tactic_cache.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ constexpr const char* kCacheMagic = "ort_cuda_gemm_tactic_cache";
4343
constexpr const char* kCacheFormatVersion = "v1";
4444

4545
// Bump whenever profiling or tactic selection changes which tactic wins, so stale caches are rejected.
46-
constexpr const char* kTacticSelectionVersion = "1";
46+
constexpr const char* kTacticSelectionVersion = "2";
4747

4848
constexpr const char* kTableMatMulNBits = "matmulnbits_fpa_intb";
4949

@@ -119,6 +119,7 @@ struct MatMulNBitsKey {
119119
bool has_zero_points = false;
120120
std::string zero_point_dtype; // e.g. "uint4b_t" / activation dtype / "none"
121121
bool gemv_enabled = false;
122+
bool has_bias = false;
122123
int packing_sm = 0;
123124

124125
bool operator==(const MatMulNBitsKey& o) const;

‎onnxruntime/contrib_ops/cuda/quantization/matmul_nbits.cc‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,8 @@ void MatMulNBits<T>::RunGemmProfile(bool hasWeightOnlyCudaKernel, int min_m, int
716716
const auto dtype = std::is_same_v<T, BFloat16> ? onnxruntime::llm::nvinfer::DataType::kBF16
717717
: onnxruntime::llm::nvinfer::DataType::kHALF;
718718
gemmId_ = GemmIdCore(n_16b, static_cast<int>(K_), dtype, kernel_sm, static_cast<int>(nbits_),
719-
static_cast<int>(block_size_), has_zero_points_, hasWeightOnlyCudaKernel);
719+
static_cast<int>(block_size_), has_zero_points_, hasWeightOnlyCudaKernel, has_bias_,
720+
this->GetDeviceProp().name);
720721

721722
GemmDims dims = {min_m, max_m, n_16b, K_};
722723
gemmProfiler_->profileTactics(weightOnlyGemmRunner_, gemmId_.dtype, dims, gemmId_, hasWeightOnlyCudaKernel);

‎onnxruntime/python/tools/fpa_intb_tune.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def _summarize_cache(cache_path: str) -> None:
144144
"block_size",
145145
"has_zero_points",
146146
"gemv_enabled",
147+
"has_bias",
147148
"packing_sm",
148149
]
149150
key = tuple(fields[n_key_col[c]] for c in key_cols if c in n_key_col)

0 commit comments

Comments
 (0)