Skip to content

Commit

Permalink
Structural refactor of the compilation_pipelines module (#529)
Browse files Browse the repository at this point in the history
This is part 1 of a QJIT refactor which reorganizes some of the classes
and methods in the `compilation_pipelines.py` module. The second part
will refactor the `QJIT` class itself.

Benefits:
- a new `tracing` sub-module is created that will over time contain all
functionality pertaining to program capture from
Python
- reusable functions are grouped together by their purpose, such as
signature handling and debugging
- classes and modules are slimmed down and more focused
- improved docstrings

Linting is not done yet, and I will also add changelog.

[sc-57014]

---------

Co-authored-by: erick-xanadu <110487834+erick-xanadu@users.noreply.github.com>
  • Loading branch information
dime10 and erick-xanadu authored Feb 21, 2024
1 parent 9a94ec6 commit 96fef3b
Show file tree
Hide file tree
Showing 16 changed files with 862 additions and 638 deletions.
5 changes: 2 additions & 3 deletions doc/dev/debugging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ Below is an example of how to obtain a C program that can be linked against the
def identity(x):
return x
print(identity.get_cmain(1.0))
print(debug.get_cmain(identity, 1.0))
Using the ``QJIT.get_cmain`` function, the following string is returned to the user:
Using the ``debug.get_cmain`` function, the following string is returned to the user:

.. code-block:: C
Expand Down Expand Up @@ -298,4 +298,3 @@ And finally some real LLVMIR adhering to the QIR specification:
The LLVMIR code is compiled to an object file using the LLVM static compiler and linked to the
runtime libraries. The generated shared object is stored by the caching mechanism in Catalyst
for future calls.

2 changes: 1 addition & 1 deletion frontend/catalyst/ag_primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

import catalyst
from catalyst.ag_utils import AutoGraphError
from catalyst.utils.contexts import EvaluationContext
from catalyst.tracing.contexts import EvaluationContext
from catalyst.utils.jax_extras import DynamicJaxprTracer, ShapedArray
from catalyst.utils.patching import Patcher

Expand Down
Loading

0 comments on commit 96fef3b

Please sign in to comment.