You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 24, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 24, 2026. It is now read-only.
I am trying to use bitblas.Linear with A_dtype="int8" and W_dtype="int4".
I expected the output to be all 16.0 (since both inputs and weights are filled with ones), but I got unexpected values.
importtorchimportbitblasbatch_size=1num_tokens=2in_features=16out_features=32model=bitblas.Linear(
in_features=in_features,
out_features=out_features,
bias=False,
A_dtype="int8", # activation A dtypeW_dtype="int4", # weight W dtypeaccum_dtype="int32", # accumulation dtypeout_dtype="float32", # output dtype# configs for weight only quantizationgroup_size=None, # setting for grouped quantizationwith_scaling=False, # setting for scaling factorwith_zeros=False, # setting for zeroszeros_mode=None, # setting for how to calculating zeros# Target optimization var for dynamic symbolic.# For detailed information please checkout docs/PythonAPI.md# By default, the optimization var is [1, 16, 32, 64, 128, 256, 512]opt_M=[1, 16, 32, 64, 128],
)
x=torch.ones((batch_size, num_tokens, in_features)).to(torch.int8)
w=torch.ones((out_features, in_features)).to(torch.int8)
x=x.cuda()
w=w.cuda()
model=model.cuda()
model.load_and_transform_weight(w)
model.eval()
withtorch.no_grad():
y=model(x)
print(y)
Activity