-
Notifications
You must be signed in to change notification settings - Fork 17
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
accuracy variation depending on the number of GPUs used #2
Comments
After cleaning the code I've only tested for cifar 50 steps where results where exactly reproduced. I'm re-launching 10 steps to check that. |
OK, thank you very much! |
Hey, so I haven't time to full reproduce 10 steps with a single GPU but the first 5 steps are indeed like yours. I think the error comes from that with two GPUs, I'm actually using a batch size twice larger (PyTorch's DDP will use So what you can do is modifying the #######################
# DyTox, for CIFAR100 #
#######################
# Model definition
model: convit
embed_dim: 384
depth: 6
num_heads: 12
patch_size: 4
input_size: 32
local_up_to_layer: 5
class_attention: true
# Training setting
no_amp: true
eval_every: 50
# Base hyperparameter
weight_decay: 0.000001
batch_size: 128
incremental_lr: 0.0005
incremental_batch_size: 256 # UPDATE VALUE
rehearsal: icarl_all
# Knowledge Distillation
auto_kd: true
# Finetuning
finetuning: balanced
finetuning_epochs: 20
# Dytox model
dytox: true
freeze_task: [old_task_tokens, old_heads]
freeze_ft: [sab]
# Divergence head to get diversity
head_div: 0.1
head_div_mode: tr
# Independent Classifiers
ind_clf: 1-1
bce_loss: true
# Advanced Augmentations, here disabled
## Erasing
reprob: 0.0
remode: pixel
recount: 1
resplit: false
## MixUp & CutMix
mixup: 0.0
cutmix: 0.0 If you have time to tell me if it's working better great, otherwise I'll check it in the coming weeks. Since I'm 100% sure the results are reproducible with two GPUs, the problem must be that. |
Hum... I'm launching experiments with batch size of 256 (the yaml that I gave you only did it for step t>1 not t=0 my bad), with a LR of 0.0005 (the default one) and a LR of 0.001 (twice bigger as it would have been if using two GPUs). I'm also enabling mixed-precision ( I'll keep you updated. |
HI, Posting it here because I'm having the same issue. I ran the Dytox model on Cifar-100 with the same setting as in the first comment here, on a single GPU, and I'm getting the following log
Is this accuracy expected? The final accuracy (54.61) is lower than the number I see on the paper for cifar-100, 10 steps. I'm trying to understand how multi-gpu training alone can bring in such a big improvement. Any help would be much appreciated. |
Hello, I'm still trying to improve perfs on a single GPU. I'll keep this issue updated if I find ways to do it. In the mean time, try running on two GPUs, as the results have been reproduced by multiple people (including @zhl98 for openned this issue). |
Hi, Just a short update. I thought repeated augmentation could be the reason behind improved results in multi-GPU, so I ran it without RA, but I was still getting around 59% accuracy, which means that cannot be the reason. Please let us know if you were able to figure out how to make it work in single-GPU setting. |
Yeah, I chatted with Hugo Touvron (the DeiT main author) and he also suggested RA. I've tried multi-gpu without RA and single-gpu with RA, and nothing significantly changed. I'll keep you updated. |
Accuracy variation is in major part explained in the following erratum. |
Hello,Thank you very much for your code!
I used the setting of dytox in the code for 10 steps of training, but I failed to achieve the accuracy in the paper.
bash train.sh 0 --options options/data/cifar100_10-10.yaml options/data/cifar100_order1.yaml options/model/cifar_dytox.yaml --name dytox --data-path MY_PATH_TO_DATASET --output-basedir PATH_TO_SAVE_CHECKPOINTS
Here is the reproduction result:
avg acc is 69.54.
Can you give me some advice? thank you very much!
The text was updated successfully, but these errors were encountered: