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

[WIP] gpt_fused #189

Closed
wants to merge 9 commits into from
Closed

[WIP] gpt_fused #189

wants to merge 9 commits into from

Conversation

cpuhrsch
Copy link
Contributor

A torchao version of gpt-fast's model.py for experimentation.

Currently just a copy-paste of gpt-fast's model.py to get feedback on the idea.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 29, 2024
@cpuhrsch cpuhrsch requested a review from msaroufim April 29, 2024 22:59
For example

```
PYTHONPATH=/home/cpuhrsch/local/ao/torchao/prototype/models/gpt_fused CUDA_VISIBLE_DEVICES=0 numactl --membind 0 --cpubind 0 python generate.py --compile --checkpoint_path checkpoints/$MODEL_REPO/model.pth --prompt "Hello, my name is"
Copy link
Member

Choose a reason for hiding this comment

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

what's going on here lol, why do i need to set the python path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So that the import statements in gpt-fast pick up on the location of model.py in torchao

@@ -0,0 +1,13 @@
## gpt-fused

A more handwritten version of [gpt-fast](https://github.com/pytorch-labs/gpt-fast)'s model.py for us to experiment with.
Copy link
Member

Choose a reason for hiding this comment

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

wdym by more handwritten?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could use this to try various fused kernels (Triton or CUDA).

@@ -0,0 +1,255 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
Copy link
Member

Choose a reason for hiding this comment

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

could you add a file in test or benchmark script that would just sanity check that the script works with real and random weights

Also why prototype namespace? I think torchao.models.gpt is better, i expect a lot of people will use this as is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using prototype just to get started. Yes, we can add a benchmark script. I'll work on that next.

Copy link
Member

@msaroufim msaroufim left a comment

Choose a reason for hiding this comment

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

OK! Feel free to do the benchmark script and namespace change in a future PR

@cpuhrsch cpuhrsch marked this pull request as draft April 30, 2024 00:02
@msaroufim msaroufim mentioned this pull request May 13, 2024
7 tasks
Copy link

pytorch-bot bot commented May 14, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/189

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures

As of commit de8400d with merge base e7bbbd2 (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@msaroufim msaroufim closed this Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants