-
Notifications
You must be signed in to change notification settings - Fork 721
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
Define baseline target environment for AOT compilations #7635
Comments
Thanks, is the next step to discuss the OMR issue at an OMR architecture meeting ? |
Yeah I asked that eclipse-omr/omr#4518 be added to the architecture meeting. That said, after an offline discussion with @mpirvu, maybe going down that road isn't absolutely necessary. Since it isn't particularly likely that a portable SCC is not going to be in a container of some sort, Marius suggested that using an option to inform the JVM that the current run is the "populate SCC" run should be sufficient. Such an option would cause the global target environment to be set to some base level, which would result in even the JIT'd code targeting that arch level; however, because this run would be part of the container build step whose main purpose is to populate the SCC, it doesn't matter too much if the JIT'd code's quality isn't the best. I think the subtleties still remain in the multi-SCC world.
|
I thought about this some more and talked to @mpirvu offline more about his idea about the option, which I misunderstood; he actually suggested specifying the target environment. After that discussion, I'm in favour of going down that road as well. We would need something like:
The general semantics would be:
The process would be as follows: Scenario 1: Traditional: User runs with Scenario 2: Last Populate Run: User runs with The Because in #7630 we learned that there is only one |
Closing this in favour of the discussion in #7966 |
Currently, the target environment of AOT code is essentially the host environment. However, the need for defining some baseline target environment has risen with the arrival of the multi-layer SCC feature. The point of having multi-layer SCCs is to facilitate having SCCs in different layers in Docker images; images that are, by design, portable. While the AOT Header validation [1] does validate that the processors and other features are compatible, there are some problems - problems which have always been there; it's just that generally in a single SCC world, the SCC does not move from the machine on which it was generated.
The problems generally stem from the processor validations. Specifically:
The way to deal with both problems is to do what all static compilers do. Define some baseline target environment with the reasonably widest possible coverage. This depends on eclipse-omr/omr#4518 (and associated OpenJ9 changes that will have to follow).
Obviously there are some subtleties that have to be considered. For example, because the generated AOT code is also run on the machine on which it is generated in a normal cold run, the features of host have to be a superset of a baseline target environment; otherwise the host becomes the baseline target environment. Another example is, in the second run, if the code in the SCC was generated on a machine who's features are a subset of the baseline target environment, then the AOT code should again only be targeted to use only the features specified in the SCC.
This is also relevant for JITServer, as the target of the compilation could be a machine that is different from where the compilation occurs.
[1] https://github.com/eclipse/openj9/blob/dc7b78cbd099a1188d018d9b43c2d4e51933d8a3/runtime/compiler/runtime/RelocationRuntime.cpp#L1022
1 - By "optional dynamic relocatable compilation", I mean the decision to compile some method is made at runtime (dynamic) and the decision to generate position independent code for a particular compilation (relocatable compilation) is also made at runtime (optional).
The text was updated successfully, but these errors were encountered: