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

[DAPHNE–#696] Cost-aware function specialization #836

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

XejgaToast
Copy link

Batur (Exion007) + Ahmad (XejgaToast)

Naming convention

  • Added a new naming convention of specialized Functions (more readable IR)
  • Added a duplicate specialization prevention (no duplicate specializations anymore) depending on the naming convention

Recursion Detection/Prevention in specialization

  • Added a call graph to keep track of recursion
  • Added a recursion detection and prevention with an hard coded upper limit of 5 recursive calls per recursive cycle to prevent too many specializations

Removal of non-beneficial specializations

  • Added a hash map to keep track of function bodies and compare them to find potentially equal functions with different names
  • Delete specialized functions which already have an equal function and replace callee attributes to point to existing function

Documentation

  • Added documentation for the Specialization Pass itself
  • Adjusted documentation for a couple of functions

@pdamme pdamme self-requested a review October 1, 2024 14:43
@pdamme pdamme added the LDE summer 2024 Student project in the course Large-scale Data Engineering at TU Berlin (summer 2024). label Oct 1, 2024
@pdamme
Copy link
Collaborator

pdamme commented Oct 1, 2024

Thanks @XejgaToast and @Exion007 for this contribution. Solving the task described in #696 is very welcome. I will make an initial pass over this PR soon.

It was only for debugging
@Exion007
Copy link

Exion007 commented Nov 7, 2024

Added new test script

This test script tests 3 aspects simultaneously by comparing the IR with the expected IR output (specializeIRTest.txt), which are the following:

  • Similar Function detection and prevention (function c is expected to be replaced with function b)
  • Recursion detection and prevention (function a is expected to only have 5 recursive calls, meaning 6 specializations)
  • Naming Convention (All function names in the IR should follow the naming convention)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LDE summer 2024 Student project in the course Large-scale Data Engineering at TU Berlin (summer 2024).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants