Skip to content

Commit e97e2ef

Browse files
committed
resolve nan issue
1 parent 83163bc commit e97e2ef

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/diffusers/models/modeling_utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,8 +1238,6 @@ def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.P
12381238
}
12391239

12401240
# Dispatch model with hooks on all devices if necessary
1241-
print(model.transformer_blocks[0].attn.to_q.weight)
1242-
print(model.transformer_blocks[0].attn.to_q.weight_scale_inv)
12431241
if device_map is not None:
12441242
device_map_kwargs = {
12451243
"device_map": device_map,

src/diffusers/quantizers/finegrained_fp8/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def act_quant_kernel(x_ptr, y_ptr, s_ptr, BLOCK_SIZE: tl.constexpr):
3838
pid = tl.program_id(axis=0)
3939
offs = pid * BLOCK_SIZE + tl.arange(0, BLOCK_SIZE)
4040
x = tl.load(x_ptr + offs).to(tl.float32)
41-
s = tl.max(tl.abs(x)) / 448.0
41+
s = tl.max(tl.abs(x)) / 448.0 + 1e-6
4242
y = x / s
4343
y = y.to(y_ptr.dtype.element_ty)
4444
tl.store(y_ptr + offs, y)

0 commit comments

Comments
 (0)