Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/cpu/features/int8_recipe_tuning/int8_autotune.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def train(dataloader, model, loss_fn, optimizer):

epochs = 5
for t in range(epochs):
print(f"Epoch {t+1}\n-------------------------------")
print(f"Epoch {t + 1}\n-------------------------------")
train(train_dataloader, model, loss_fn, optimizer)
print("Done!")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1158,8 +1158,8 @@ def main():
print(
f"Step {training_steps:5d}: loss: {gloss:6.3f} lm_acc: {lm_acc:.3f} \
seq_acc: {seq_acc:.3f} lbs: {args.train_batch_size} gbs: {total_batch_size} \
DT: {(t1-t0)*1000.0:.1f} XT: {(t2-t1)*1000.0:.1f} FT: {(t3-t2)*1000.0:.1f} \
BT: {(t4-t3)*1000.0:.1f} OT: {(t5-t4)*1000.0:.1f} TT: {(t5-t0)*1000.0:.1f}"
DT: {(t1 - t0) * 1000.0:.1f} XT: {(t2 - t1) * 1000.0:.1f} FT: {(t3 - t2) * 1000.0:.1f} \
BT: {(t4 - t3) * 1000.0:.1f} OT: {(t5 - t4) * 1000.0:.1f} TT: {(t5 - t0) * 1000.0:.1f}"
)

update_step = training_steps % args.gradient_accumulation_steps == 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ def trace_handler(prof):
generated, _ = generate()
t_generate_span = time.time() - t_generate_start
for i, o, _ in generated:
print_rank0(f"{'-'*60}\nin={i}\nout={o}\n")
print_rank0(f"{'-' * 60}\nin={i}\nout={o}\n")

# benchmark it!
else:
Expand Down
8 changes: 4 additions & 4 deletions intel_extension_for_pytorch/llm/modules/mha_fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,12 +553,12 @@ class PagedAttention:
alibi_slopes (torch.Tensor, optinal): which is the alibi slope with the shape of (num_heads).
softcap (float): the positive softcap value to apply on the attention weights, default is -1.
[class method]: flash_atten_varlen
[class method]: flash_attn_varlen_func
.. highlight:: python
.. code-block:: python
ipex.llm.modules.PagedAttention.flash_atten_varlen(
ipex.llm.modules.PagedAttention.flash_attn_varlen_func(
out,
query,
key_cache,
Expand All @@ -573,8 +573,8 @@ class PagedAttention:
alibi_slopes,
window_size_left,
window_size_right,
k_scale,
v_scale
k_scale=k_scale,
v_scale=v_scale
)
Args:
Expand Down