mirror of
https://github.com/openai/CLIP.git
synced 2026-11-05 01:37:26 +00:00
[GH-ISSUE #198] Can I know why clip model outputs are changed by batch size?? #173
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openai/CLIP#173
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @larcane97 on GitHub (Dec 16, 2021).
Original GitHub issue: https://github.com/openai/CLIP/issues/198
Hi, first of all, Thank you for sharing clip model coed and brilliant idea!! :)
during the model experiments, I found that clip model's outputs are changed by batch size,
But I couldn't come up with why this values are changed.. could you tell me why this is happening?
below is the code to reproduce !
@jongwook commented on GitHub (Apr 11, 2022):
This is unfortunately true for most of CUDA programs. The runtime is free to select different implementations (for matrix multiplication, etc.) depending on the batch size, even between subsequent calls, and they might introduces slightly numerical differences similar to what you're seeing. Running models in fp32 will likely reduce the discrepancy, and check out some documentations regarding the determinism issue from NVIDIA and PyTorch which might also help.