Skip to content

Commit

Permalink
fix: handles race condition on parallel config directory creation (#285)
Browse files Browse the repository at this point in the history
In parallel runs of the regression tests, the compilation server might
fail when checking/loading the config file.

This change handles the specific case where those files are checked as
non existent, but when they attempting to create it, they would return
`FileExistsError`.

examples:
[1](https://github.com/CentML/playground/actions/runs/9601931045)
[2](https://github.com/CentML/playground/actions/runs/9601633511)

If you think this should be handled some other way, just let me know and
i'll make the change.
  • Loading branch information
c-fteixeira authored and vadiklyutiy committed Jul 22, 2024
1 parent 6ddca7f commit 33bb7a3
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions python/hidet/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,8 @@ def register_hidet_options():
description='The auth token to use for accessing private huggingface models.',
)

config_file_path = os.path.join(os.path.expanduser('~'), '.config', 'hidet')
if not os.path.exists(config_file_path):
os.makedirs(config_file_path)
config_file_path = os.path.join(config_file_path, 'hidet.toml')
# Load hidet config
config_file_path = os.path.join(os.path.expanduser('~'), '.config', 'hidet', 'hidet.toml')
if os.path.exists(config_file_path):
_load_config(config_file_path)

Expand Down

0 comments on commit 33bb7a3

Please sign in to comment.