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

Successful pip Installation Results in ModuleNotFoundError #910

Closed
6 of 8 tasks
casey-martin opened this issue Dec 4, 2023 · 7 comments
Closed
6 of 8 tasks

Successful pip Installation Results in ModuleNotFoundError #910

casey-martin opened this issue Dec 4, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@casey-martin
Copy link

casey-martin commented Dec 4, 2023

Please check that this issue hasn't been reported before.

  • I searched previous Bug Reports didn't find any similar reports.

Expected Behavior

Following the Quickstart instructions, I installed the axolotl module without any errors. I would expect to be able to load axolotl using the python interpreter or by executing scripts through axolotl.cli.inference.

Current behaviour

Attempting to load the module or run any scripts results in a ModuleNotFoundError.

Steps to reproduce

$ mamba create -n phi python=3.9
$ mamba activate phi
$ pip3 install "axolotl[flash-attn,deepspeed] @ git+https://github.com/OpenAccess-AI-Collective/axolotl"
$ accelerate launch -m axolotl.cli.train ./phi-ft.yml --deepspeed ./deepspeed/zero1.json                                                                                                                                                                                        
The following values were not passed to `accelerate launch` and had defaults used instead:
        `--num_processes` was set to a value of `1`                          
        `--num_machines` was set to a value of `1`                            
        `--mixed_precision` was set to a value of `'no'`                                                                                                     
        `--dynamo_backend` was set to a value of `'no'`                       
To avoid this warning pass in values for each of the problematic parameters or run `accelerate config`.                                                      
/home/user/mambaforge/envs/phi/bin/python3.9: Error while finding module specification for 'axolotl.cli.train' (ModuleNotFoundError: No module named 'axolotl.cli')

Config yaml

base_model: microsoft/phi-1_5
model_type: PhiForCausalLM
tokenizer_type: AutoTokenizer
is_llama_derived_model: false
trust_remote_code: true

load_in_8bit: false
load_in_4bit: false
strict: false

datasets:
  - path: garage-bAInd/Open-Platypus
    type: alpaca

dataset_prepared_path:
val_set_size: 0.05
output_dir: ./phi-sft-out

sequence_len: 2048
sample_packing: true
pad_to_sequence_len:

adapter:
lora_model_dir:
lora_r:
lora_alpha:
lora_dropout:
lora_target_linear:
lora_fan_in_fan_out:

wandb_project:
wandb_entity:
wandb_watch:
wandb_run_id:
wandb_log_model:

gradient_accumulation_steps: 1
micro_batch_size: 1
num_epochs: 4
optimizer: adamw_torch
adam_beta2: 0.95
adam_epsilon: 0.00001
max_grad_norm: 1.0
lr_scheduler: cosine
learning_rate: 0.000003

train_on_inputs: false
group_by_length: true
bf16: true
fp16: false
tf32: true

gradient_checkpointing:
early_stopping_patience:
resume_from_checkpoint:
local_rank:
logging_steps: 1
xformers_attention:
flash_attention:

warmup_steps: 100
eval_steps: 0.05
save_steps:
debug:
deepspeed:
weight_decay: 0.1
fsdp:
fsdp_config:
resize_token_embeddings_to_32x: true
special_tokens:
  bos_token: "<|endoftext|>"
  eos_token: "<|endoftext|>"
  unk_token: "<|endoftext|>"
  pad_token: "<|endoftext|>"

Possible solution

Installation using the git instructions is successful.

$ accelerate launch -m axolotl.cli.train ./phi-ft.yml --deepspeed ./deepspeed/zero1.json                                                                                                                                                                                        
The following values were not passed to `accelerate launch` and had defaults used instead:                                                                                                                                                                                                                                 
        `--num_processes` was set to a value of `1`                                                                                                                                                                                                                                                                        
        `--num_machines` was set to a value of `1`                                                                                                                                                                                                                                                                         
        `--mixed_precision` was set to a value of `'no'`                                                                                                                                                                                                                                                                   
        `--dynamo_backend` was set to a value of `'no'`                                                                                                                                                                                                                                                                    
To avoid this warning pass in values for each of the problematic parameters or run `accelerate config`.                                                                                                                                                                                                                    
/home/user/mambaforge/envs/phi/lib/python3.9/site-packages/transformers/deepspeed.py:23: FutureWarning: transformers.deepspeed module is deprecated and will be removed in a future version. Please import deepspeed modules directly from transformers.integrations                                                     
  warnings.warn(                                                                                                                                                                                                                                                                                                           
                                 dP            dP   dP                                                                                                                                                                                                                                                                     
                                 88            88   88                                                                                                                                                                                                                                                                     
      .d8888b. dP.  .dP .d8888b. 88 .d8888b. d8888P 88                                                                                                                                                                                                                                                                     
      88'  `88  `8bd8'  88'  `88 88 88'  `88   88   88                                                                                                                                                                                                                                                                     
      88.  .88  .d88b.  88.  .88 88 88.  .88   88   88                                                                                                                                                                                                                                                                     
      `88888P8 dP'  `dP `88888P' dP `88888P'   dP   dP  

Which Operating Systems are you using?

  • Linux
  • macOS
  • Windows

Python Version

3.9

axolotl branch-commit

main/4d6490b

Acknowledgements

  • My issue title is concise, descriptive, and in title casing.
  • I have searched the existing issues to make sure this bug has not been reported yet.
  • I am using the latest version of axolotl.
  • I have provided enough information for the maintainers to reproduce and diagnose the issue.
@casey-martin casey-martin added the bug Something isn't working label Dec 4, 2023
@Peter-Devine
Copy link

Peter-Devine commented Dec 6, 2023

+1

@XesGaDeus
Copy link

found same error with runpod quickstart template

The following values were not passed toaccelerate launchand had defaults used instead:--num_processeswas set to a value of1 --num_machineswas set to a value of1 --mixed_precisionwas set to a value of'no' --dynamo_backendwas set to a value of'no'To avoid this warning pass in values for each of the problematic parameters or runaccelerate config`.
/root/miniconda3/envs/py3.10/bin/python3: Error while finding module specification for 'axolotl.cli.train' (ModuleNotFoundError: No module named 'axolotl')
Traceback (most recent call last):
File "/root/miniconda3/envs/py3.10/bin/accelerate", line 8, in
sys.exit(main())
File "/root/miniconda3/envs/py3.10/lib/python3.10/site-packages/accelerate/commands/accelerate_cli.py", line 47, in main
args.func(args)
File "/root/miniconda3/envs/py3.10/lib/python3.10/site-packages/accelerate/commands/launch.py", line 994, in launch_command
simple_launcher(args)
File "/root/miniconda3/envs/py3.10/lib/python3.10/site-packages/accelerate/commands/launch.py", line 636, in simple_launcher
raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
subprocess.CalledProcessError: Command '['/root/miniconda3/envs/py3.10/bin/python3', '-m', 'axolotl.cli.train', 'config.yml']' returned non-zero exit status 1.

`

@13rac1
Copy link

13rac1 commented Dec 12, 2023

Odd, the code package is missing from site-packages. Temporary workaround is to make a symlink from python3.??/site-packages/axolotl to the axolotl repo's src/axolotl or copy the source.

@Praful932
Copy link

Facing similar issue on a kaggle notebook, cannot see the axolotl package directory under site-packages
image

@ajinkya123-robo
Copy link

Just running pip3 install -e '.[flash-attn,deepspeed]' once again in my venv solved the issue.

@karlkovaciny
Copy link

I don't know if this module is supposed to run on Databricks, but the workarounds don't help there since I can't symlink or upload entire directories into the workspace. Running with subprocess.run or cloning the repo didn't help either.

@NanoCode012
Copy link
Collaborator

Closing this as duplicate of #945

The current workaround is to git clone and pip install following readme : #945 (comment)

@NanoCode012 NanoCode012 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants