MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / _

Function _

tensorrt_llm/_torch/utils.py:228–234  ·  view source on GitHub ↗
(sf, rows, cols, scaling_vector_size=16)

Source from the content-addressed store, hash-verified

226
227@torch.library.register_fake("trtllm::reswizzle_sf")
228def _(sf, rows, cols, scaling_vector_size=16):
229 sf_cols = ceil_div(cols, scaling_vector_size)
230 padded_rows, padded_sf_cols = compute_swizzled_sf_shape(rows, sf_cols)
231 num_partitions = sf.numel() // (padded_rows * padded_sf_cols)
232 total_rows = num_partitions * rows
233 sz = pad_up(total_rows, 128) * pad_up(cols, 4)
234 return sf.new_empty(sz)
235
236
237def next_positive_power_of_2(x: int) -> int:

Callers

nothing calls this directly

Calls 4

ceil_divFunction · 0.90
pad_upFunction · 0.90
numelMethod · 0.45

Tested by

no test coverage detected