-
Notifications
You must be signed in to change notification settings - Fork 217
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
Added mamba model support and test CI script #1573
base: main
Are you sure you want to change the base?
Conversation
Just run the command |
examples/text-generation/README.md
Outdated
```bash | ||
wget https://huggingface.co/Habana/mamba/resolve/main/hpu_custom_pscan_all.cpython-310-x86_64-linux-gnu_119.so | ||
wget https://huggingface.co/Habana/mamba/resolve/main/libcustom_tpc_perf_lib_119.so | ||
export HABANA_CUSTOM_OP_DIR=/path/of/hpu_custom_pscan_all.cpython-310-x86_64-linux-gnu_119.so located | ||
export GC_KERNEL_PATH=/path/to/libcustom_tpc_perf_lib_119.so:$GC_KERNEL_PATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be done automatically in the script if the model type is Mamba
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test did the automatically download, but for users want to run the mamba, they can just download the so files form the Habana/mamba card.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also remove the wget and use hf_hub_download in the test script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will discourage many users to use this model. Can't we put the code you added to the test file to donwload the .so in a new utils file in the Mamba modeling folder? And then we could call it here and in the test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just readme file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you mean. I think automatically downloading these .so files in the script if the model type is mamba would give a better user experience. Why not doing it there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zzhang37 it seems the mamba run code fails if we don't set this environment variable at all. Is this intended? Can customer run with/without custom code? If the intention is always run mamba with custom kernel, we should put all these download/setup code in modeling_mamba file at the beginning before you load the library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code quality check failed, please run |
Co-authored-by: Wei Lin <[email protected]> Co-authored-by: Jianqian Zhou <[email protected]> Co-authored-by: Leo Zhao <[email protected]>
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Fixed the make style issue. |
Co-authored-by: Gustavo <gustavo.malkomes> Co-authored-by: Yaser Afshar <[email protected]> Co-authored-by: regisss <[email protected]>
Co-authored-by: Adam Stachowicz <[email protected]>
…gface#1596) Signed-off-by: Wang, Yi A <[email protected]>
@zzhang37 There are some new issues now but these should be quite straightforward to fix:
|
@regisss GC_KERNEL_PATH is used by all models. There is a default path for GC_KERNEL_PATH, but mamba required an additional path to add .The problem is GC_KERNEL_PATH needs to be set before the start of the script since Synapse needs to use this path to load the TPC kernels in the beginning, if we add additional path to GC_KERNEL_PATH in the middle of the script, it will miss the loading of the additional kernels we added in the path, the mamba will not able to use that kernel. So that is the reason if we run mamba model, we need to add additional path to GC_KERNEL_PATH beforehand rather than in the middle of the script. Just like command we should use is |
What does this PR do?
Added Mamba model support using custom op, and added the test on Mamba, the test command is
GAUDI2_CI=1 RUN_SLOW=1 python -m pytest tests/test_text_generation_example.py -s -v -k "mamba"
It passed on 1.18.0release and 1.19.0, build 497 with corresponding so files.
Fixes # (issue)
Before submitting