Comments (16)
An end-to-end demo - i.e. how to collect a corpus, how to train, etc - is given here. The training driver is this one.
from ml-compiler-opt.
Hi Amir,
Our to-be-published paper might be the best resources for RL details. We are prioritizing it and will publish it hopefully next week. Before that, the end-to-end demo Mircea mentioned may be the best resources to look at
from ml-compiler-opt.
https://arxiv.org/abs/2101.04808 for the paper.
from ml-compiler-opt.
For TF and TF-Agents versions, we just updated it to the latest. There is no specific feature we need from the latest version, so an earlier version may also work.
from ml-compiler-opt.
Fuchsia is just used as a project to extract a corpus from. You can replace it with anything else that's clang-based, so you can extract a compilation database, from which you then extract the IR corpus. We liked Fuchsia because it yields a reasonably sized IR corpus, and it's open source; and we've been working with them because they were interested in size reduction, so a good part of the demo was basically ready-written.
We'll clarify that in the demo, reading it again, I see that Fuchsia is sprung up rather surprisingly.
Let us know if you run into any trouble trying it out with a clang-based project.
from ml-compiler-opt.
from ml-compiler-opt.
Thanks. We will be interested in citing the work sometime soon. It would be great to have an official paper to refer to for numbers and methodology.
Sure. I'd appreciate if you provide details on training the RL. Believe should be this file ? Also, I noticed you changed the TF version to a latest nightly version. Was it because of using a latest TF framework for RL?
Regards,
-- Amir
from ml-compiler-opt.
Re. TF version, it was about a TFAgents dependency. @ebrevdo @yundiqian @jaingaurav for TFAgents details.
from ml-compiler-opt.
@mtrofin Thanks for the paper.
Looking at the demo tutorial, I don't seem to understand the role of Fushsia in training RL. Can the training driver be used without the Fuchsia OS?
from ml-compiler-opt.
Thanks. One small thing is compiler_opt/tools/generate_tfrecord.py
, has been renamed to generate_default_trace.py
, you might wanna revise the demo.md as well.
from ml-compiler-opt.
Thanks - fixed!
from ml-compiler-opt.
Fuchsia is just used as a project to extract a corpus from. You can replace it with anything else that's clang-based, so you can extract a compilation database, from which you then extract the IR corpus. We liked Fuchsia because it yields a reasonably sized IR corpus, and it's open source; and we've been working with them because they were interested in size reduction, so a good part of the demo was basically ready-written.
We'll clarify that in the demo, reading it again, I see that Fuchsia is sprung up rather surprisingly.
Let us know if you run into any trouble trying it out with a clang-based project.
Hi, thanks for the demo and the great paper! I am a liitle bit confused about what you mean by "clang-based`, is that this method cannot be applied to standard C++ codebase?
from ml-compiler-opt.
"clang-based" refers to the target project needing to be compiled with clang. That's not a comment about C++ standard compliance, just to the practical realities of C++ projects - switching compilers (e.g. gcc -> clang) is non-trivial, so the comment underlines the fact that, as long as a project is already using clang, one should be able to use this work.
For more context: our work is about replacing the internals of the compiler (starting with inlining decision heuristics) with a learned policy. The work is done in the LLVM (hence clang) repo (llvm-project/llvm). This repo here (google/ml-compiler-opt) handles the training side, which happens offline, outside of the compiler. In addition, our goal is productization. For this latter reason, we're keeping our focus to LLVM, which may impact assumptions in this (google/ml-compiler-opt) repo.
Probably the ideas can be applied elsewhere, and likely those assumptions I mentioned aren't many and the work in this repo can be generalized to handle training data from other compilers, but that's not within the scope of our work. Having said that, if there's strong interest to extend this project, we'd be happy to set it up for contribution and welcome patches!
from ml-compiler-opt.
from ml-compiler-opt.
Sorry, I saw the comment go, so I deleted mine, too, figuring maybe there was a mistake :)
Looking forward to collaborating on learned loop transforms, should you decide to apply to GSoC - let us know if you need more info meanwhile, too!
Also, there's this monthly meeting (described here) - feel free to join! Perhaps a reasonable topic for the agenda for the April meeting should be the related GSoC projects.
from ml-compiler-opt.
Thanks! This would be super useful and I am looking forward to next month's meeting. I am already drafting my purpose for the project and it would be great if you can take a look. Any feedbacks would be helpful!
from ml-compiler-opt.
Related Issues (20)
- 【Question】How to use GPU training, just install tensorflow-gpu? will there be better performance if using a larger model? HOT 1
- 【Question】Why use llvm-size to calculate rewards? llvm also calculates size rewards? HOT 2
- 【Question】Can you open the code of ES algorithm? HOT 2
- 【Question】What parameters need to be passed in to compile the data set? -Oz -Xclang -fembed-bitcode=all? HOT 2
- How to train a model using bin's llvmbc and llvmcmd segments?I want to optimize directly using the executable program HOT 6
- Why can’t I use llvmbc and llvmcmd of executable programs?
- questions about feature log HOT 1
- Is it not very accurate to use the size reward of the entire file as the reward for each caller-callee feature, if the file is large and has a large number of caller-callee? HOT 1
- What does the size of sequence_examples depend on, and how to set its size? HOT 5
- Does llvm-15.04 support mlgo? What versions of tensorflow and other libraries are needed? HOT 1
- Why is the length of the reward limited to 3 or more? HOT 3
- How to know the effect of model inlining when training the model? HOT 1
- how to get model.tflite file from inlining-Oz-99f0063-v1.1.tar.gz HOT 1
- Why “-static” affects the test results of the model HOT 2
- why need to calculate reward_stat? I see llvm_trainer.train use reward from sequence_example.reward HOT 1
- Can I merge all the bc files into a total bc file for training?
- How to compile other dataset using llvm's thinlto flag?
- Where do I find pretrained models for MLGOPerf? HOT 4
- `--compile_task` flag missing HOT 2
- [non-issue] MLGO Questions HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ml-compiler-opt.