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

Speed up scheduler #10

Open
Philogy opened this issue Jun 9, 2024 · 0 comments
Open

Speed up scheduler #10

Philogy opened this issue Jun 9, 2024 · 0 comments
Labels
QoL Quality of Life improvement research

Comments

@Philogy
Copy link
Owner

Philogy commented Jun 9, 2024

Having a quite large search space the optimal Dijkstra scheduler is quite slow, essentially investigating the best options breadth-first until a solution is found.

Implementation wise there's still some low-hanging fruit that could improve performance mainly:

  • pruning the graphs to be scheduled pre-search: The IRGraph represents a function as a DAG with vertices being "computations" (function calls / opcodes / constant instantiations) and edges either being data or read/write dependencies. In many situations read/write dependencies could be pruned if nodes are already defined as being dependent in some other way (indirect data or read/write dependency). This would speed up the algorithm as every time a node is undone all its connections have to be iterated through. Pruning would be a one-time effort and provide a minimal but continuous speed-up.

The biggest performance improvements will come from designing a better heuristic for the A* scheduler. Thanks to the properties of A*, as long as the heuristic is admissible (i.e. never over-estimates the remaining distance) the final result is still guaranteed to be optimal unlike the current default heuristic "Guessoor", which delivers decent results but doesn't have the best guarantees.

A better heuristic may require a slight modification of the scheduler to allow for non-whole number cost values.

Once a better algorithm is found the compiler can be extended to speed up scheduling even further (at the cost of the solution's optimality) via bounded relaxation.

@Philogy Philogy added QoL Quality of Life improvement research labels Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QoL Quality of Life improvement research
Projects
None yet
Development

No branches or pull requests

1 participant