Skip to content

Conversation

@ShawnXuan
Copy link
Contributor

@ShawnXuan ShawnXuan commented Sep 3, 2024

This PR introduces the ability to specify the target device (e.g., CUDA, NPU, XPU) for Llama inference. The changes allow users to select the desired device through configuration, improving flexibility across different hardware platforms.

  • npu
python projects/Llama/pipeline.py --device=npu --mode=huggingface --config_file=projects/Llama/configs/llama_config_npu.py
  • xpu
python projects/Llama/pipeline.py --device=xpu --mode=huggingface --config_file=projects/Llama/configs/llama_config_xpu.py
  • cuda

Please update the projects/Llama/configs/llama_config.py file to configure the model path and tokenizer path.

python projects/Llama/pipeline.py

@ShawnXuan ShawnXuan requested review from oneflow-ci-bot and removed request for oneflow-ci-bot September 4, 2024 07:09
@ShawnXuan ShawnXuan requested review from oneflow-ci-bot and removed request for oneflow-ci-bot September 4, 2024 07:19
Copy link
Contributor

@xiezipeng-ML xiezipeng-ML left a comment

Choose a reason for hiding this comment

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

no problem

* feat: support third-party device oneflow extentions

also, refactor the build process of model and tokenizer using
pretrained_model_path cofnig

* refactor: remove unnecessary config and warnings

* docs: update readme for commands to run llama on npu and xpu
@ShawnXuan ShawnXuan requested review from oneflow-ci-bot and removed request for oneflow-ci-bot September 4, 2024 08:41
@ShawnXuan ShawnXuan requested review from oneflow-ci-bot and removed request for oneflow-ci-bot September 4, 2024 08:46
@ShawnXuan ShawnXuan removed the request for review from oneflow-ci-bot September 4, 2024 08:52
@ShawnXuan ShawnXuan requested review from oneflow-ci-bot and xiezipeng-ML and removed request for oneflow-ci-bot September 4, 2024 08:55
@0x404 0x404 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot September 4, 2024 10:05
@ShawnXuan ShawnXuan merged commit 1efccd8 into main Sep 5, 2024
@ShawnXuan ShawnXuan deleted the llama_device branch September 5, 2024 02:25
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.

5 participants