Class QuantTpSharding
java.lang.Object
smile.llm.quant.QuantTpSharding
Shard-then-pack helpers for tensor-parallel quantized linears.
Column-parallel shards out_features; row-parallel shards
in_features. Callers pack the local shard into Marlin / FP8 after
sharding (never pack globally then slice).
-
Method Summary
Modifier and TypeMethodDescriptionstatic TensorshardAwqQweightColumn(Tensor qweight, int tpSize, int tpRank) Column-parallel shard of AWQqweight[in, out/8]along packed out.static TensorshardAwqQweightRow(Tensor qweight, int tpSize, int tpRank) Row-parallel shard of AWQqweight[in, out/8]along K.static TensorshardColumn(Tensor weight, int tpSize, int tpRank) Column-parallel shard of a dense weight[out, in](or FP8).static TensorshardGptqQweightColumn(Tensor qweight, int tpSize, int tpRank) Column-parallel shard of GPTQqweightpacked along input dim0 ([in/8, out]).static TensorshardGptqQweightRow(Tensor qweight, int tpSize, int tpRank) Row-parallel shard of GPTQqweight[in/8, out]along packed K.static TensorRow-parallel shard of a dense weight[out, in].static TensorshardScalesColumn(Tensor scales, int tpSize, int tpRank) Column-parallel shard of scales[groups, out]along out.static TensorshardScalesRow(Tensor scales, int tpSize, int tpRank) Row-parallel shard of scales[groups, out]along groups (K groups).
-
Method Details
-
shardColumn
-
shardRow
-
shardGptqQweightColumn
Column-parallel shard of GPTQqweightpacked along input dim0 ([in/8, out]). Shards alongout.- Parameters:
qweight- GPTQ packed weights.tpSize- tensor-parallel world size.tpRank- this rank.- Returns:
- sharded qweight (caller owns).
-
shardGptqQweightRow
-
shardAwqQweightColumn
-
shardAwqQweightRow
-
shardScalesColumn
-
shardScalesRow
-