Skip to content

Commit 5ce7d75

Browse files
authored
An example of how to ingest ACFs in Helion (#121)
1 parent ebc65d7 commit 5ce7d75

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

problems/helion/fp8_quant_py/submission.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,23 @@
33
import torch
44
import helion
55
import helion.language as hl
6+
from pathlib import Path
67

8+
COFIG_DICT={
9+
"block_sizes": [1],
10+
"num_warps": 1,
11+
"num_stages": 1,
12+
}
13+
14+
ACF_FILE = "booster_pack/fp8_group_quant_0.acf"
15+
if Path(ACF_FILE).exists():
16+
print(f"Using ACF file: {ACF_FILE}")
17+
COFIG_DICT["advanced_controls_file"] = ACF_FILE
718

819
# NOTE: This is an intentionally inefficient baseline implementation.
920
@helion.kernel(
1021
static_shapes=True,
11-
config=helion.Config(block_sizes=[1], num_warps=1, num_stages=1),
22+
config=helion.Config(**COFIG_DICT),
1223
)
1324
def normalize_to_range(
1425
data: torch.Tensor, # [N, G] input rows

0 commit comments

Comments
 (0)