Skip to content

support baichuan model:#4721

Merged
mrwyattii merged 11 commits intodeepspeedai:masterfrom
baodii:baichuan_support
Dec 18, 2023
Merged

support baichuan model:#4721
mrwyattii merged 11 commits intodeepspeedai:masterfrom
baodii:baichuan_support

Conversation

@baodii
Copy link
Contributor

@baodii baodii commented Nov 23, 2023

  • fix Baichuan meta data error
  • add BaichuanLayer and DecoderLayer to glmtype when prepare tp fused qkvw
  • add get_alibi_mask function for Baichuan to enable TP

   * fix Baichuan meta data error
   * add BaichuanLayer and DecoderLayer to glmtype when prepare tp fused qkvw
   * add get_alibi_mask function for Baichuan to enable TP
@baodii
Copy link
Contributor Author

baodii commented Nov 23, 2023

@delock

@delock
Copy link
Collaborator

delock commented Nov 28, 2023

Hi @RezaYazdaniAminabadi, this PR contains fixes for AutoTP to allow Baichuan model running with DeepSpeed AutoTP, can you review this PR for any comments? Thanks!

Copy link
Contributor

@RezaYazdaniAminabadi RezaYazdaniAminabadi left a comment

Choose a reason for hiding this comment

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

all LGTM, thanks :)

if hasattr(self.module.transformer, 'build_mpt_alibi_tensor'):
self.module.transformer.build_mpt_alibi_tensor_orig = self.module.transformer.build_mpt_alibi_tensor
self.module.transformer.__class__.build_mpt_alibi_tensor = build_mpt_alibi_tensor
if hasattr(self.module, 'model'):
Copy link
Collaborator

Choose a reason for hiding this comment

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

@baodii - would it be possible to add a unit test for this model support?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@baodii - would it be possible to add a unit test for this model support?

@delock is it necessary to add a single model's autoTP unit test?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should add autoTP tests with a seperate workflow in a seperate PR, there are several reasons:

  1. Current autotp coverage in inference UT is not adequate (marian, codegen only), many popular model are not tested
  2. Popular model has large disk/memory requirement, put them in a seperate workflow allows us to isolate the hardware requirements
  3. It is suggested to test these autotp test with deepspeed launcher rather than pytest distributed launcher, this could avoid additional complexity and as close to user environment as possible.

I think we can open an issue for this task and explore in a seperate task.

@mrwyattii mrwyattii merged commit c20f6fa into deepspeedai:master Dec 18, 2023
mrwyattii added a commit that referenced this pull request Jan 10, 2024
This [PR](#4721) added the
"DecoderLayer":glmtype. It will cause the Falcon model to choose
"glmtype" fused_qkv_type. Falcon model (including Falcondecoderlayer)
needs to choose 'bloomtype' explicitly.

Co-authored-by: Michael Wyatt <michaelwyatt@microsoft.com>
mauryaavinash95 pushed a commit to mauryaavinash95/DeepSpeed that referenced this pull request Feb 17, 2024
* fix Baichuan meta data error
* add BaichuanLayer and DecoderLayer to glmtype when prepare tp fused
qkvw
   * add get_alibi_mask function for Baichuan to enable TP

---------

Co-authored-by: Lai, Yejing <yejing.lai@intel.com>
Co-authored-by: Reza Yazdani <44502768+RezaYazdaniAminabadi@users.noreply.github.com>
Co-authored-by: Logan Adams <114770087+loadams@users.noreply.github.com>
Co-authored-by: Olatunji Ruwase <olruwase@microsoft.com>
Co-authored-by: Michael Wyatt <michaelwyatt@microsoft.com>
mauryaavinash95 pushed a commit to mauryaavinash95/DeepSpeed that referenced this pull request Feb 17, 2024
This [PR](deepspeedai#4721) added the
"DecoderLayer":glmtype. It will cause the Falcon model to choose
"glmtype" fused_qkv_type. Falcon model (including Falcondecoderlayer)
needs to choose 'bloomtype' explicitly.

Co-authored-by: Michael Wyatt <michaelwyatt@microsoft.com>
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.

7 participants