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

Checks for user injection policy #3052

Merged
merged 12 commits into from Sep 3, 2023

Conversation

satpalsr
Copy link
Contributor

@satpalsr satpalsr commented Mar 18, 2023

This PR introduces check for user injection policy arguments.
Right now, below code executes without any error/warning even though user injection policy is not used.

from transformers import pipeline
import deepspeed

pythia_pipe = pipeline('text-generation', 'EleutherAI/pythia-160m-deduped', device=0)
injection_policy = {"blah blah": "some more blah blah"}
pythia_pipe.model = deepspeed.init_inference(pythia_pipe.model, replace_with_kernel_inject=False, injection_policy=injection_policy ,dtype=torch.half, enable_cuda_graph=False)

prompt = "Pythia combines interpretability analysis and"
response = pythia_pipe(prompt, max_new_tokens=50, return_full_text=False, do_sample=False)

This PR enforces correct usage of injection_policy with necessary checks.

@jeffra jeffra requested a review from lekurile March 23, 2023 17:08
@satpalsr
Copy link
Contributor Author

satpalsr commented Apr 5, 2023

Hey @lekurile,
If you have some time can you please review this.

@lekurile
Copy link
Contributor

lekurile commented Apr 6, 2023

Hey @lekurile, If you have some time can you please review this.

Hi @satpalsr,

Thank you for the contribution! I left a review comment about moving the check out of replace_transformer_layer(). Could you please take a look?

Thanks,
Lev

@satpalsr
Copy link
Contributor Author

satpalsr commented Apr 7, 2023

Hey @lekurile,

Thanks for checking, but I somehow can't find your review. As I understand you are suggesting to move the function out. Will make changes. Thanks.

@lekurile
Copy link
Contributor

lekurile commented Apr 7, 2023

Hey @lekurile,

Thanks for checking, but I somehow can't find your review. As I understand you are suggesting to move the function out. Will make changes. Thanks.

Hi @satpalsr,

Sorry, didn't submit the review earlier. Should be visible now.

Thanks,
Lev

Copy link
Contributor

@lekurile lekurile left a comment

Choose a reason for hiding this comment

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

@satpalsr Can you please run pre-commit as well to resolve formatting issues?
https://github.com/microsoft/DeepSpeed/blob/master/CONTRIBUTING.md#prerequisites

@satpalsr
Copy link
Contributor Author

satpalsr commented Apr 7, 2023

I see formatting failing. Though there's no formatting issues in my changes. I see issue in general_kernals.cu
Should I still change that here?

@lekurile lekurile self-assigned this Aug 18, 2023
@lekurile
Copy link
Contributor

Hi @satpalsr,

Apologies for the delayed response. I think we'd still like to merge this change, but it would be nice to merge the latest master and rerun tests again. I'll take another look at the formatting issues as well.

Thanks,
Lev

@lekurile lekurile added this pull request to the merge queue Sep 2, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 2, 2023
@lekurile lekurile added this pull request to the merge queue Sep 3, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 3, 2023
@lekurile lekurile added this pull request to the merge queue Sep 3, 2023
Merged via the queue into microsoft:master with commit 430510b Sep 3, 2023
16 checks passed
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.

None yet

3 participants