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

Add nanogpt_train to torchbench, and merge with nanogpt_generate into joint folder #1911

Closed
wants to merge 5 commits into from

Conversation

xmfan
Copy link
Member

@xmfan xmfan commented Sep 20, 2023

Currently, we have nanogpt_generate, which is the inference only version of https://github.com/karpathy/nanoGPT/blob/master/sample.py. This PR adds the training component, simplified from https://github.com/karpathy/nanoGPT/blob/master/train.py.

Tests

unit tests:
> python test.py -k "test_nanogpt_"
pass

for accuracy check:
> python benchmarks/dynamo/torchbench.py --float16 -dcuda --training --backend=inductor --ddp --multiprocess --accuracy --collect-outputs --only nanogpt 
pass

for perf measurement:
> python benchmarks/dynamo/torchbench.py --float16 -dcuda --training --backend=inductor --ddp --multiprocess --performance --only nanogpt 
1.547x

@xmfan xmfan temporarily deployed to docker-s3-upload September 20, 2023 00:30 — with GitHub Actions Inactive
@xmfan xmfan temporarily deployed to docker-s3-upload September 20, 2023 00:30 — with GitHub Actions Inactive
@xmfan xmfan temporarily deployed to docker-s3-upload September 20, 2023 02:59 — with GitHub Actions Inactive
@xmfan xmfan temporarily deployed to docker-s3-upload September 20, 2023 02:59 — with GitHub Actions Inactive
@xmfan xmfan temporarily deployed to docker-s3-upload September 20, 2023 06:26 — with GitHub Actions Inactive
@xmfan xmfan temporarily deployed to docker-s3-upload September 20, 2023 06:26 — with GitHub Actions Inactive
@xmfan xmfan marked this pull request as ready for review September 20, 2023 16:38
@xmfan xmfan requested a review from yf225 September 20, 2023 16:40
@xmfan xmfan changed the title [WIP] Add nanogpt_train to torchbench Add nanogpt_train to torchbench Sep 20, 2023
@xuzhao9
Copy link
Contributor

xuzhao9 commented Sep 20, 2023

Can we merge nanogpt_train with nanogpt_generate? Their model.py looks similiar and it is better to have a model with both inference and train tests.

@xmfan
Copy link
Member Author

xmfan commented Sep 20, 2023

@xuzhao9 by merging, should we combine them into a new nanogpt model folder, or just reuse the model.py? Also what should be the task associated to the model? I think nanogpt_generate is NLP.GENERATION whereas for training we would want to use NLP.LANGUAGE_MODELING

@xuzhao9
Copy link
Contributor

xuzhao9 commented Sep 20, 2023

@xuzhao9 by merging, should we combine them into a new nanogpt model folder, or just reuse the model.py? Also what should be the task associated to the model? I think nanogpt_generate is NLP.GENERATION whereas for training we would want to use NLP.LANGUAGE_MODELING

Yes, if they have the same origin, we should combine them into a new nanogpt model folder. In this case, let's follow the training test and use NLP.LANGUAGE_MODELING.

@xmfan xmfan temporarily deployed to docker-s3-upload September 20, 2023 22:33 — with GitHub Actions Inactive
@xmfan xmfan temporarily deployed to docker-s3-upload September 20, 2023 22:33 — with GitHub Actions Inactive
@xmfan
Copy link
Member Author

xmfan commented Sep 20, 2023

nanogpt_generate was included in some CI skips, which need to be renamed too so that we don't break CI

benchmark: #1916 rename done in this PR
pytorch: pytorch/pytorch#109746, will update with this torchbench commit pin

@xmfan xmfan requested a review from drisspg September 20, 2023 22:36
@xmfan xmfan changed the title Add nanogpt_train to torchbench Add nanogpt_train to torchbench, and merge with nanogpt_generate into joint folder Sep 20, 2023
Copy link
Contributor

@xuzhao9 xuzhao9 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for merging nanogpt!

@drisspg
Copy link
Contributor

drisspg commented Sep 21, 2023

@msaroufim these changes shouldn't mess up the dashboard right?

@xmfan
Copy link
Member Author

xmfan commented Sep 21, 2023

@drisspg Since the dashboard only aggregates (logs) this change should be safe. Once we land this PR, we will update the torchbench commit hash in pytorch repo. The dashboard's job (logs) will checkout the new torchbench version, run all models under torchbenchmark/models/ and aggregate the benchmark results

@facebook-github-bot
Copy link
Contributor

@xmfan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@xmfan
Copy link
Member Author

xmfan commented Sep 21, 2023

@pytorchbot merge

@facebook-github-bot
Copy link
Contributor

@xmfan merged this pull request in d00b942.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants