Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Conversation

@KSGulin
Copy link

@KSGulin KSGulin commented Apr 12, 2023

There's currently a bug with scaling down batch size for QAT, as batch size must be a multiple of the world size but it can be set to 1 when scaling down. This fix updates the batch size floor to be equal to the world size.

Test plan
Tested locally with command

python -m torch.distributed.run --no_python --nproc_per_node 2 \
  sparseml.yolov5.train \
  --cfg yolov5x6.yaml \
  --weights "zoo:cv/detection/yolov5-x6/pytorch/ultralytics/coco/pruned75-none" \
  --recipe "zoo:cv/detection/yolov5-x6/pytorch/ultralytics/voc/pruned75_quant-none" \
  --data coco128.yaml \
  --batch-size 2 \
  --gradient-accum-steps 32 \
  --hyp hyps/hyp.VOC.yaml \
  --imgsz 1280 \
  --patience 0 \
  --workers 4

@KSGulin KSGulin requested review from a team, DaltheCow, anmarques and markurtz and removed request for a team April 12, 2023 16:23
@KSGulin KSGulin self-assigned this Apr 12, 2023
@KSGulin KSGulin changed the title Batch world size [Bug-fix] Set batch size min to world size Apr 12, 2023
@KSGulin KSGulin merged commit 7c8d7b9 into master Apr 12, 2023
KSGulin added a commit that referenced this pull request Apr 12, 2023
* Set batch size min to world size

* Remove unused arg
KSGulin added a commit that referenced this pull request Apr 12, 2023
* Set batch size min to world size

* Remove unused arg
bfineran added a commit that referenced this pull request Apr 17, 2023
#200 included a side change to remove the now unused `image_size` arg from the function signature but did not update the call site.

this PR fixes that.

**test_plan:**
Reproduced reported error with a sample quantization recipe and verified this PR resolves it
bfineran added a commit that referenced this pull request Apr 17, 2023
)

#200 included a side change to remove the now unused `image_size` arg from the function signature but did not update the call site.

this PR fixes that.

**test_plan:**
Reproduced reported error with a sample quantization recipe and verified this PR resolves it
bfineran added a commit that referenced this pull request Apr 17, 2023
)

#200 included a side change to remove the now unused `image_size` arg from the function signature but did not update the call site.

this PR fixes that.

**test_plan:**
Reproduced reported error with a sample quantization recipe and verified this PR resolves it
bfineran added a commit that referenced this pull request Apr 17, 2023
)

#200 included a side change to remove the now unused `image_size` arg from the function signature but did not update the call site.

this PR fixes that.

**test_plan:**
Reproduced reported error with a sample quantization recipe and verified this PR resolves it
bfineran added a commit that referenced this pull request Apr 17, 2023
) (#203)

#200 included a side change to remove the now unused `image_size` arg from the function signature but did not update the call site.

this PR fixes that.

**test_plan:**
Reproduced reported error with a sample quantization recipe and verified this PR resolves it
bfineran added a commit that referenced this pull request Apr 17, 2023
) (#204)

#200 included a side change to remove the now unused `image_size` arg from the function signature but did not update the call site.

this PR fixes that.

**test_plan:**
Reproduced reported error with a sample quantization recipe and verified this PR resolves it
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants