NVlabs / MaskLLM

[NeurIPS 24 Spotlight] MaskLLM: Learnable Semi-structured Sparsity for Large Language Models
https://vainf.github.io/maskllm-project-page
Other
101 stars 11 forks source link

Unable to import Megatron, please specify the path to Megatron using --megatron-path. Exiting. #3

Open Ruban-07 opened 2 weeks ago

Ruban-07 commented 2 weeks ago

I've successfully completed till downloading llama models in HF format by running the below script:

python scripts/tools/download_llama2_7b_hf.py 
python scripts/tools/download_llama2_13b_hf.py
python scripts/tools/download_llama3_8b_hf.py

And also got this folder structure:

Description

Then I've ran the below command to convert HF to Megatron:

bash scripts/tools/convert_llama2_7b_hf_to_megatron.sh 
bash scripts/tools/convert_llama2_13b_hf_to_megatron.sh 
bash scripts/tools/convert_llama3_8b_hf_to_megatron.sh

Unfortunately, I'm facing the below errors:

Screenshot from 2024-10-16 17-20-57 Screenshot from 2024-10-16 17-22-06

I've tried adding the path of megatron in my env variable, but it not worked, kindly help me to fix this issue

VainF commented 2 weeks ago

Hi @Ruban-07, were these scripts executed within a Nvidia docker environment? It seems that Megatron might not be properly installed.

Ruban-07 commented 1 week ago

Hi @Ruban-07, were these scripts executed within a Nvidia docker environment? It seems that Megatron might not be properly installed.

Hi @VainF , Thank you so much for responding!!!

Actually I've created an conda new environment in the name of maskllm and cloned this repo. Inside the MaskLLM, I've executed these scripts, which is in the below screenshot:

Screenshot from 2024-10-11 05-54-00

How can I verify that the megatron installed properly or not???

VainF commented 1 week ago

I also tried to install Megatron without Docker. But it's a bit complicated since there are other dependencies like transformer_engine. I think using official and pre-built docker can solve this problem.

Ruban-07 commented 1 week ago

I also tried to install Megatron without Docker. But it's a bit complicated since there are other dependencies like transformer_engine. I think using official and pre-built docker can solve this problem.

Okay @VainF , I'll check with that.