Skip to content

Do not create device when not using device#3279

Closed
zcbenz wants to merge 1 commit intoml-explore:mainfrom
zcbenz:no-device-no-use
Closed

Do not create device when not using device#3279
zcbenz wants to merge 1 commit intoml-explore:mainfrom
zcbenz:no-device-no-use

Conversation

@zcbenz
Copy link
Copy Markdown
Collaborator

@zcbenz zcbenz commented Mar 19, 2026

  • Do not call default_device() on initialization.
  • Do not clear compile cache on exit which initializes device eventually, it is meaningless since it simply clears a std::map.

@zcbenz zcbenz force-pushed the no-device-no-use branch from d38b379 to fd8ddf3 Compare March 19, 2026 08:20
@zcbenz zcbenz force-pushed the no-device-no-use branch from fd8ddf3 to 935c985 Compare March 19, 2026 08:25
@angeloskath
Copy link
Copy Markdown
Member

Hm the cache clearing could actually be a problem. The reason is that the C++ compiler cache can outlive the python interpreter and it will keep python data that when destroyed will try to acquire the GIL which is not available since the python interpreter has exited.

@zcbenz
Copy link
Copy Markdown
Collaborator Author

zcbenz commented Mar 19, 2026

Ah that makes sense, it would be a lot more tricky to ensure thread safety then, I'll revisit this later.

@zcbenz zcbenz closed this Mar 19, 2026
@zcbenz zcbenz deleted the no-device-no-use branch March 20, 2026 02:26
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.

2 participants