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

feat: 2-3x inference speedup, faster than real-time #71

Merged
merged 17 commits into from
Feb 25, 2024

Conversation

vatsalaggarwal
Copy link
Member

@vatsalaggarwal vatsalaggarwal commented Feb 22, 2024

dirty fix to speed up inference by porting gpt-fast... supports single utterance only, no batching...

First stage only:
RTX 4090: 230T/s (~1.5 seconds of speech generated in 1 second of wall-clock time)
H100: 382T/s (~2.5 seconds of speech generated in 1 second of wall-clock time)

These times are consistent across context lengths due to the static kv-cache used.

Notes:

  • it can take a while to start up the first time (~1-3 minutes)
  • due to compilation, restarting the script pays a penalty of ~20-50second

@vatsalaggarwal vatsalaggarwal self-assigned this Feb 22, 2024
This was referenced Feb 22, 2024
@vatsalaggarwal vatsalaggarwal changed the title feat: 2.5x inference speedup, faster than real-time feat: 2-3x inference speedup, faster than real-time Feb 22, 2024
Copy link
Member

@sidroopdaska sidroopdaska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

few clarifications requested

fam/llm/gptfast_model.py Outdated Show resolved Hide resolved
fam/llm/gptfast_model.py Outdated Show resolved Hide resolved
fam/llm/gptfast_sample_utils.py Outdated Show resolved Hide resolved
fam/llm/gptfast_sample_utils.py Outdated Show resolved Hide resolved
fam/llm/gptfast_sample_utils.py Outdated Show resolved Hide resolved
fam/llm/gptfast_sample_utils.py Outdated Show resolved Hide resolved
num_samples=1,
seed=1337,
device="cuda",
dtype="bfloat16",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auto handle dtype. check fam/llm/utils.py

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

README.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants