Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Frontend] calling qjit(keep_intermediate=True) multiple times #306

Merged
merged 28 commits into from
Oct 12, 2023

Conversation

erick-xanadu
Copy link
Contributor

@erick-xanadu erick-xanadu commented Oct 6, 2023

Context: Having a single workspace for a single python function to be compiled could lead to an error when the same function was compiled multiple times or another function with the same name was compiled. It also wasn't entirely clear what the behaviour should be when using keep_intermediate and a function was recompiled.

Description of the Change: Now when two functions of the request the same name, a new directory will be created appending _$NUM.

Benefits: No issues with compiling functions with the same name.

Possible Drawbacks:

Related GitHub Issues: closes #291

[sc-47499]
[sc-46567]

@codecov
Copy link

codecov bot commented Oct 6, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (2280c80) 99.51% compared to head (fff71e9) 99.52%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #306   +/-   ##
=======================================
  Coverage   99.51%   99.52%           
=======================================
  Files          40       41    +1     
  Lines        7270     7322   +52     
  Branches      423      428    +5     
=======================================
+ Hits         7235     7287   +52     
  Misses         17       17           
  Partials       18       18           
Files Coverage Δ
frontend/catalyst/compilation_pipelines.py 100.00% <100.00%> (ø)
frontend/catalyst/compiler.py 100.00% <100.00%> (ø)
frontend/catalyst/utils/filesystem.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@erick-xanadu erick-xanadu marked this pull request as ready for review October 10, 2023 15:06
@dime10 dime10 added this to the Catalyst v0.3.1 milestone Oct 11, 2023
@dime10
Copy link
Contributor

dime10 commented Oct 11, 2023

Maybe that's a silly question, but why wouldn't the compiler driver not just overwrite any existing files if the working directory already exists? I believe that was the previous behaviour in Python.

@erick-xanadu
Copy link
Contributor Author

Not a silly question! I'm not sure, let me dig into it.

Copy link
Contributor

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

Also a good solution!

I wonder what the trade-off is for handling this in the frontend is though, if it is an issue in the compiler driver. With this design, would it simply be an "API misuse" if the compiler driver was fed a directory that already had files in it?

frontend/test/pytest/test_jit_behaviour.py Outdated Show resolved Hide resolved
frontend/catalyst/compilation_pipelines.py Outdated Show resolved Hide resolved
frontend/catalyst/compiler.py Show resolved Hide resolved
frontend/catalyst/compilation_pipelines.py Outdated Show resolved Hide resolved
Copy link
Contributor

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

🦝

@dime10 dime10 merged commit 1bec389 into main Oct 12, 2023
19 checks passed
@dime10 dime10 deleted the eochoa/2023-10-05/shared-lib-manager branch October 12, 2023 03:15
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.

Setting qjit keep_intermediate=True flag leads to memory corruptions
2 participants