axolotl
axolotl copied to clipboard
Successful pip Installation Results in ModuleNotFoundError
Please check that this issue hasn't been reported before.
- [X] 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?
- [X] Linux
- [ ] macOS
- [ ] Windows
Python Version
3.9
axolotl branch-commit
main/4d6490b
Acknowledgements
- [X] My issue title is concise, descriptive, and in title casing.
- [X] I have searched the existing issues to make sure this bug has not been reported yet.
- [X] I am using the latest version of axolotl.
- [X] I have provided enough information for the maintainers to reproduce and diagnose the issue.
+1
found same error with runpod quickstart template
The following values were not passed to
accelerate launchand had defaults used instead:
--num_processeswas set to a value of
1
--num_machineswas set to a value of
1
--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 run
accelerate 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
`
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.
Facing similar issue on a kaggle notebook, cannot see the axolotl package directory under site-packages
Just running pip3 install -e '.[flash-attn,deepspeed]' once again in my venv solved the issue.
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.
Closing this as duplicate of https://github.com/OpenAccess-AI-Collective/axolotl/issues/945
The current workaround is to git clone and pip install following readme : https://github.com/OpenAccess-AI-Collective/axolotl/issues/945#issuecomment-1900798307