Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load LLMs in FP16 for Faster Inference #10

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Checkpoint
  • Loading branch information
Kyle1668 committed Aug 9, 2023
commit f4b02c06f8597a7d4fe79bc6d89cc6dad3ac516f
4 changes: 2 additions & 2 deletions inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ def accumilate_inference_log(
inference_log["generation_perplexity"] = perplexities[index][1]
inference_log["sequence_perplexity"] = perplexities[index][2]
if "attn" in features:
process_args = [layer_index, attention_layer for layer_index, attention_layer in enumerate(outputs.attentions)]
p = Process(target=get_layer_entropy, args=(e, index, total_entropy, total_gini, inference_log, layer_index, attention_layer))
# process_args = [layer_index, attention_layer for layer_index, attention_layer in enumerate(outputs.attentions)]
# p = Process(target=get_layer_entropy, args=(e, index, total_entropy, total_gini, inference_log, layer_index, attention_layer))
for layer_index, attention_layer in enumerate(outputs.attentions):
get_layer_entropy(e, index, total_entropy, total_gini, inference_log, layer_index, attention_layer)

Expand Down