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

How to choose batch size? #11

Open
GitFTuan opened this issue Nov 21, 2024 · 1 comment
Open

How to choose batch size? #11

GitFTuan opened this issue Nov 21, 2024 · 1 comment

Comments

@GitFTuan
Copy link

Dear Developer. I am currently trying to learn and replicate the "Mutate Everything" project. However, I noticed a discrepancy: in the article, the batch size is described as 3, while the GitHub README uses a batch size of 1. Additionally, when I set the batch size to a value greater than 1, I encounter an error in data.py at the line ret['one_letter_idx'] = one_letter_idx. This issue might be caused by the protein sequences having varying lengths, which are not aligned, leading to the error. Could you please suggest a solution for this problem?Thank you.

Image
Image2

@jozhang97
Copy link
Owner

Hi,

Thanks for your interest. Below is the command copy pasted from the README. The per-GPU batch size is 1 but we are using 3 GPUs, thus the effective batch size is 3. We use openfold which only permits a batch size of 1.

Solution is to use 3 gpus. If only one GPU is available try batch size of 1, though I'm unsure you will get the same solution.

torchrun **--nproc_per_node=3** main_train.py \
    **--batch_size 1** \
    --finetune_backbone models/finetuning_ptm_2.pt \
    --data_path data/cdna/mutations/cdna_train.csv \
    --eval_data_paths data/s669/mutations/s669.csv \
    --dist_eval \
    --backbone af \
    --lambda_double 0. --lambda_single 1. \
    --eval_period 999 --epochs 20 --warmup_epochs 2 --save_period 20 \
    --disable_wandb \
    --output_dir logs/af_single

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

2 participants