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

not use tune run,how can I run the code. #2235

Open
belle9217 opened this issue Jan 7, 2025 · 3 comments
Open

not use tune run,how can I run the code. #2235

belle9217 opened this issue Jan 7, 2025 · 3 comments

Comments

@belle9217
Copy link

If I use pip install --pre --upgrade torchtune --extra-index-url https://download.pytorch.org/whl/nightly/cpu, and I need to modify the code in the torchtune package in the environment, it's not easy, how can you quickly modify the code?

@RdoubleA
Copy link
Contributor

RdoubleA commented Jan 7, 2025

Hi @belle9217, could you provide a few more details on what you are trying to do? You should not need to modify the code in the package files itself.

Generally, if you want to copy and modify an existing config or recipe in the library, you can use tune cp (see here) to create a local copy in your project directory, and then you can edit however you want. This will need to be run with tune run to launch a fine-tuning job.

@dz1iang
Copy link

dz1iang commented Jan 8, 2025

The following script can run on a single machine.

NPROC_PER_NODE=$(nvidia-smi --query-gpu=name --format=csv,noheader | wc -l)

DISTRIBUTED_LAUNCH_ARGS=(
    --nproc_per_node $NPROC_PER_NODE
    --nnodes 1
    --node_rank 0
    --master_addr 127.0.0.1
    --master_port 29500
)
torchrun ${DISTRIBUTED_LAUNCH_ARGS[@]} recipes/full_finetune_distributed.py --config recipes/configs/qwen2_5/0.5B_full.yaml

@belle9217
Copy link
Author

@dz1iang yes,it works,that is all I need.

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

No branches or pull requests

3 participants