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

deepspeed mii fastgen example #2779

Merged
merged 21 commits into from
Dec 14, 2023
Merged

deepspeed mii fastgen example #2779

merged 21 commits into from
Dec 14, 2023

Conversation

lxning
Copy link
Collaborator

@lxning lxning commented Nov 9, 2023

Description

Please read our CONTRIBUTING.md prior to creating your first pull request.

Please include a summary of the feature or issue being fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #(issue)
#2780

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Feature/Issue validation/testing

Please describe the Unit or Integration tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced.
Please also list any relevant details for your test configuration.

  • Test A
    Logs for Test A

  • Test B
    Logs for Test B

Checklist:

  • Did you have fun?
  • Have you added tests that prove your fix is effective or that this feature works?
  • Has code been commented, particularly in hard-to-understand areas?
  • Have you made corresponding changes to the documentation?

Copy link
Collaborator

@mreso mreso left a comment

Choose a reason for hiding this comment

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

Overall is LGTM but I would like to move the check on LOCAL_RANK up the chain.

@@ -64,6 +64,9 @@ def create_predict_response(
:param code:
:return:
"""
if str(os.getenv("LOCAL_RANK", 0)) != "0":
Copy link
Collaborator

Choose a reason for hiding this comment

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

This low level method should not be concerned about checking the LOCAL_RANK env environment. We should just not call it when its not "0".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The checking is a central control to avoid this checking in handler implementation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I see the intention here. I still think this is not the preferred place to put this check. The function creating a response from some arguments should not need to know about the concept of ranks. In fact we already have a central point to check for the rank in this PR which is here.
The only point where this is missing is here. Looking at this I think we should move send_intermediate_predict_response out of ts.protocol.otf_message_handler (Users should not need deal with the modules containing our comms between fe/be. What if we drop otf protocol?). My first instinct is to move it under ts.handler_utils. What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm fine to move it to handler_utils. The only concern is backward compatibility. It will break existing cx.

Copy link
Collaborator

Choose a reason for hiding this comment

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

AFAIK we do not guarantee bc as of now. Its probably time to plan out our bc strategy for future release as we're running out or 0.X version numbers. Anyways, if your concern is very high you can leave a wrapper in otf_message_handler that fires a deprecation warning and then calls the one in handler_utils until next release. cx will only get worse if we let the code rot.

Copy link
Collaborator

@mreso mreso left a comment

Choose a reason for hiding this comment

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

Could you check the deprecation decorator? I've added some checks to your test that should pass but every time foo is called the warning is emitted again.

@lxning
Copy link
Collaborator Author

lxning commented Dec 14, 2023

Could you check the deprecation decorator? I've added some checks to your test that should pass but every time foo is called the warning is emitted again.

A deprecation warning message will be triggered once the deprecated function is called. For example, Two warning messages will be emitted if func foo is called twice in the test. This is what I expected. I updated the assertion:

Replace

assert len(record) == 0

with

assert len(record) == 2

@mreso
Copy link
Collaborator

mreso commented Dec 14, 2023

Could you check the deprecation decorator? I've added some checks to your test that should pass but every time foo is called the warning is emitted again.

A deprecation warning message will be triggered once the deprecated function is called. For example, Two warning messages will be emitted if func foo is called twice in the test. This is what I expected. I updated the assertion:

Replace

assert len(record) == 0

with

assert len(record) == 2

@lxning If that is the expected outcome, can we remove this?

simplefilter("once", category=(PendingDeprecationWarning, DeprecationWarning))

@lxning
Copy link
Collaborator Author

lxning commented Dec 14, 2023

Could you check the deprecation decorator? I've added some checks to your test that should pass but every time foo is called the warning is emitted again.

A deprecation warning message will be triggered once the deprecated function is called. For example, Two warning messages will be emitted if func foo is called twice in the test. This is what I expected. I updated the assertion:
Replace

assert len(record) == 0

with

assert len(record) == 2

@lxning If that is the expected outcome, can we remove this?

simplefilter("once", category=(PendingDeprecationWarning, DeprecationWarning))

Good catch. Remove this unused func. Thanks!

Copy link
Collaborator

@mreso mreso left a comment

Choose a reason for hiding this comment

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

LGTM

@mreso mreso enabled auto-merge December 14, 2023 19:45
@mreso mreso added this pull request to the merge queue Dec 14, 2023
Merged via the queue into master with commit b9086e5 Dec 14, 2023
13 checks passed
@chauhang chauhang added this to the v0.10.0 milestone Feb 27, 2024
@lxning lxning added enhancement New feature or request example labels Feb 27, 2024
@lxning lxning self-assigned this Feb 27, 2024
@lxning lxning added documentation Improvements or additions to documentation p0 high priority labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request example p0 high priority
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants