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

Update: compile updated to trace in ivy repo #22854

Merged
merged 30 commits into from
Sep 26, 2023

Conversation

HaiderSultanArc
Copy link
Contributor

@HaiderSultanArc HaiderSultanArc commented Aug 31, 2023

We are updating our ivy.compile( ) function to ivy.trace( ) function.
This requires updating the Docs, Ivy Repo, Graph Compiler Repo, Demos, and other places to refer to Tracer rather than Graph Compiler!

This PR updates Ivy Repo Code!

@HaiderSultanArc HaiderSultanArc added Next Release This issue or PR should only be considered once the next release is out. Tracer Anything related to tracing labels Aug 31, 2023
@HaiderSultanArc HaiderSultanArc self-assigned this Aug 31, 2023
@HaiderSultanArc HaiderSultanArc linked an issue Aug 31, 2023 that may be closed by this pull request
@github-actions
Copy link
Contributor

Thanks for contributing to Ivy! 😊👏
Here are some of the important points from our Contributing Guidelines 📝:
1. Feel free to ignore the run_tests (1), run_tests (2), … jobs, and only look at the display_test_results job. 👀 It contains the following two sections:
- Combined Test Results: This shows the results of all the ivy tests that ran on the PR. ✔️
- New Failures Introduced: This lists the tests that are passing on main, but fail on the PR Fork. Please try to make sure that there are no such tests. 💪
2. The lint / Check formatting / check-formatting tests check for the formatting of your code. 📜 If it fails, please check the exact error message in the logs and fix the same. ⚠️🔧
3. Finally, the test-docstrings / run-docstring-tests check for the changes made in docstrings of the functions. This may be skipped, as well. 📚
Happy coding! 🎉👨‍💻

Copy link
Contributor

@mattbarrett98 mattbarrett98 left a comment

Choose a reason for hiding this comment

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

I presume a lot of tests are failing due to what I pointed out, though I can't seem to confirm this with the CI (it just seems to show a long list of what's failing without the error messages).

Also I think you missed this https://github.com/unifyai/ivy/blob/main/ivy/__init__.py#L791 - presume this try will fail also when trying to import compile which is now trace

ivy/compiler/compiler.py Outdated Show resolved Hide resolved
@HaiderSultanArc
Copy link
Contributor Author

I presume a lot of tests are failing due to what I pointed out, though I can't seem to confirm this with the CI (it just seems to show a long list of what's failing without the error messages).

Also I think you missed this https://github.com/unifyai/ivy/blob/main/ivy/__init__.py#L791 - presume this try will fail also when trying to import compile which is now trace

Yeah I missed that 😅. Thanks for pointing out!

@guillesanbri
Copy link
Contributor

heads up before leaving a review, all the module stuff is being refactored at the moment afaik, so it will most likely become a nightmare to merge the changes 😅 I'd say better to wait to change this if the module refactor is going to be merged soon (which I assume it is)

@HaiderSultanArc
Copy link
Contributor Author

heads up before leaving a review, all the module stuff is being refactored at the moment afaik, so it will most likely become a nightmare to merge the changes 😅 I'd say better to wait to change this if the module refactor is going to be merged soon (which I assume it is)

Yeah, I'll wait for it @guillesanbri 😄.

Comment on lines 35 to 37
from ._compiler_38 import compile as _compile
from ._compiler_38 import trace as _trace
else:
from ._compiler import compile as _compile
from ._compiler import trace as _trace
Copy link
Contributor

Choose a reason for hiding this comment

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

small heads up: this will need to be changed to from ._compiler import compile as _trace as the .so won't be updated yet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep!

ivy/__init__.py Outdated
@@ -812,7 +812,7 @@ class Node(str):
except:
pass
try:
from .compiler.compiler import transpile, compile, unify
from .compiler.compiler import transpile, trace, unify
Copy link
Contributor

Choose a reason for hiding this comment

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

trace_graph here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I searched for trace( LOL. Obviously it would get missed. Sorry for that 😅

spec.loader.exec_module(module, ivy._compiled_id)
spec.loader.exec_module(
module, ivy._compiled_id
) # ! Not sure about what this ID is
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is related we can remove the comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it!

@@ -28,22 +28,22 @@ def _remove_so_log(trace):
if ".pyx" in repr(st):
continue
if "<string>" in repr(st):
if "compiled_fn" in repr(st) and module_frame:
if "traced_fn" in repr(st) and module_frame:
Copy link
Contributor

Choose a reason for hiding this comment

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

this probably needs to be compiled_fn until the changes are effective in the .so file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah makes sense!


if "<module>" in repr(st):
module_frame = old_frames[idx]
module_st = st
elif (
transpile_frame is None
and os.path.join("ivy", "compiler") in st.filename
and st.name in ["compile", "transpile"]
and st.name in ["trace", "transpile"]
Copy link
Contributor

Choose a reason for hiding this comment

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

not entirely sure about this one, so just highlighting in case it also needs to be updated only once the .so file is updated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, it's comming from .so file so it would be compile for now

@HaiderSultanArc HaiderSultanArc merged commit ae85941 into ivy-llc:main Sep 26, 2023
50 of 137 checks passed
iababio pushed a commit to iababio/ivy that referenced this pull request Sep 27, 2023
@HaiderSultanArc HaiderSultanArc deleted the compile_to_trace_ivy branch October 1, 2023 17:15
druvdub pushed a commit to druvdub/ivy that referenced this pull request Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Next Release This issue or PR should only be considered once the next release is out. Tracer Anything related to tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ivy Repo
3 participants