daphne-project / daphne-project/daphne

Sideways entry into compilation: Execution of externally modified DaphneIR code

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
AMLS summer 2022 AMLS summer 2024 student project
Dominant language
C++
Stars
81
Forks
83
PR merge metrics
No merged PRs in 30d

Description

In GitLab by @pdamme on Mar 15, 2021, 22:07

Typically, a DAPHNE user would implement an integrated data analysis pipeline using the domain-specific language DaphneDSL. The DAPHNE system parses a DaphneDSL script into an internal representation, the so-called DaphneIR, which is based on MLIR/LLVM. To give researchers and practitioners a chance to fine-tune the internal representation manually (e.g., for what-if analyses on not-yet-existing compiler optimizations), we want to support reading DaphneIR files as an alternative. Then we could print the IR at any level (see #6), modify it externally (e.g., by hand to try out variants the compiler would not come up with), and load it again to continue the processing from that point on, which could be very valuable for experiments.

Reading a text file containing DaphneIR should not be too complicated since MLIR comes with IR parsers. See, for instance, the `mlir-opt` tool included in MLIR (`thirdparty/llvm-project/mlir/tools/mlir-opt`, or https://github.com/llvm/llvm-project/tree/main/mlir/tools/mlir-opt).

The task is to extend the existing command-line API of the DAPHNE system to also accept DaphneIR files. The IR must be parsed and connected to the DAPHNE compilation chain, whereby the right entry point must be chosen carefully. Ideally, the compiler should handle it gracefully (or not change it at all) in the early passes, assuming that the compilation chain starts anew when invoking the system with a DaphneIR file. Implementation in C++.

Contributor guide

Open the contributing guide

Research direction

Start with the existing DAPHNE command-line API and compare its input handling with the MLIR mlir-opt entry point at thirdparty/llvm-project/mlir/tools/mlir-opt. Trace where DaphneDSL becomes DaphneIR and identify the compilation-chain entry point for externally read IR. Done means a DaphneIR file is accepted, parsed, connected to compilation, and handled safely by early passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.