An Example How to Implement Fork Inside CompilationSession
See original GitHub issue❓ Questions and Help
Right now, I am trying to apply a greedy search from llvm_autotuners packages over a CompilationSession
defined by myself. However, I couldn’t find any good example of how to implement forking inside the session class. No matter what I have tried (instantiation by using constructor or deepcopy
), the following error always appears: SessionNotFound
.
Could you provide any examples of how this is implemented inside llvm-v0
compilation session? I was searching for the function with this signature def fork(self) -> "CompilationSession"
, but no results.
Thanks in advance!
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Fork() in C Programming Language - Section.io
In this tutorial, we will talk about the fork() function and then implement some examples in the C programming language.
Read more >fork() in C - GeeksforGeeks
It takes no parameters and returns an integer value. Below are different values returned by fork(). Negative Value: creation of a child process ......
Read more >The fork() System Call
The purpose of fork() is to create a new process, which becomes the child process of the caller. After a new child process...
Read more >compiler_gym.service — CompilerGym 0.2.5 documentation
Base class for encapsulating an incremental compilation session. To add support for a new compiler, subclass from this base and provide implementations of...
Read more >Fork() in C Programming Language | Interviewkickstart
This section will serve as an introduction to the fork function, which is used to create a copy of processes. We will discuss...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh wow, please submit that as a patch! Looks like a bug to me 🙂
env.reset()
ends the currentCompilationSession
and creates a new one. The forked one is unaffecte:Cheers, Chris
Hi @ChrisCummins
Thanks for the explanation. I was wondering what
init
in C++ does over the__init__
in Python and you answered it.I’ll try this and provide the link to the implementation.
Hm, maybe this wasn’t about the
reset
and thestep
, but I found a weird behaviour when trying llvm_autotuners. I tried running random search over the bench dataset for a few seconds.Then I generated the .csv with all results with:
The content of the .csv file is here:
As you may notice, all 18 benchmarks are quicksort.
To fix this, I tried adding
env.reset()
after this line (env.benchmark = benchmark), and the output now looks like this (all different benchmarks):Also I have one more question. After doing
env.fork()
, wouldenv.reset()
reset the whole state of the CompilationSession? I guess so.