PennyLaneAI / PennyLaneAI/catalyst

[MLIR, CompileDriver] Run entry point signature detection only if needed

Open
#326 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement housecleaning
Dominant language
Python
Stars
234
Forks
84
Avg merge
2d 15h
Merged PRs (30d)
66

Description

Currently compile driver always attempts to detect the entry point signature (see getJITFunction) and prints messages if it can't find one, which is is only relevant for IR string input. Usually we compile Python functions where we already know signatures by design. The suggestions are:

  • Change the compiler driver API so we can explicitly ask it to run the inference, and only run it if asked
  • Maybe find a better name for this function (JIT used to be the prefix of our entry points, but we changed this)
  • Maybe also unify the verbose printing mechanisms, namely emitDIag/emitRemark of MLIR and our own CO_MSG macros. Note, that we might want to keep CO_MSG because emit*s alone get overly verbose when stack traces are enabled. Ref https://github.com/PennyLaneAI/catalyst/pull/317

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with getJITFunction in mlir/lib/Driver/CompilerDriver.cpp and the CompilerDriver API in mlir/include/Driver/CompilerDriver.h. Determine how callers can explicitly request signature inference and how the diagnostic paths should relate to CO_MSG. Done means inference is conditional for IR string input and unnecessary messages are no longer emitted for Python compilation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.