Skip to content

[quantization] Tune torch#703

Open
stamalakhov wants to merge 2 commits into
Samsung:mainfrom
stamalakhov:tune_torch
Open

[quantization] Tune torch#703
stamalakhov wants to merge 2 commits into
Samsung:mainfrom
stamalakhov:tune_torch

Conversation

@stamalakhov
Copy link
Copy Markdown
Contributor

This PR tunes torch environment to improve reproducibility of results.

Draft: #670
Related: #656

TICO-DCO-1.0-Signed-off-by: s.malakhov s.malakhov@partner.samsung.com

This PR tunes `torch` environment to improve reproducibility of results.

TICO-DCO-1.0-Signed-off-by: s.malakhov <s.malakhov@partner.samsung.com>
@stamalakhov stamalakhov self-assigned this May 13, 2026
@stamalakhov stamalakhov requested a review from mhs4670go May 13, 2026 13:26
mhs4670go
mhs4670go previously approved these changes May 13, 2026
Copy link
Copy Markdown
Contributor

@mhs4670go mhs4670go left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

torch.utils.deterministic.fill_uninitialized_memory = True
torch.backends.cuda.matmul.allow_tf32 = False
torch.backends.cudnn.allow_tf32 = False
os.environ["CUBLAS_WORKSPACE_CONFIG"] = ":4096:8"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this environment variable setup before importing torch?

CUBLAS_WORKSPACE_CONFIG should be set before CUDA/cuBLAS is initialized. Since this script already imports torch before setting it in setup_runtime(), it is not fully clear whether the setting is always applied as intended.

I think it would be safer to move it near the top of the file, before import torch, and use setdefault() so that a user-provided value is not overwritten:

import argparse
import os

os.environ.setdefault("CUBLAS_WORKSPACE_CONFIG", ":4096:8")

import pathlib
import random

Torrero
Torrero previously approved these changes May 13, 2026
Copy link
Copy Markdown
Contributor

@Torrero Torrero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

TICO-DCO-1.0-Signed-off-by: s.malakhov <s.malakhov@partner.samsung.com>
@stamalakhov stamalakhov dismissed stale reviews from Torrero and mhs4670go via c54a673 May 13, 2026 16:35
@stamalakhov stamalakhov requested review from Torrero and mhs4670go May 13, 2026 16:35
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

Successfully merging this pull request may close these issues.

3 participants