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

Serving cached AOT methods at the JITServer and loading them at the client #14017

Merged
merged 10 commits into from
Nov 27, 2021

Conversation

AlexeyKhrabrov
Copy link
Contributor

This PR completes the minimal implementation of caching compiled code at JITServer. It adds the code to serve serialized methods from the JITServer AOT cache and load them at the client.

In order to store AOT methods at the server and load them at the client,
we need a functional local SCC and the AOT compiler. If either the SCC
or the AOT compiler is not used, disable the JITServer AOT cache option.

Signed-off-by: Alexey Khrabrov <khrabrov@cs.toronto.edu>
@AlexeyKhrabrov
Copy link
Contributor Author

@mpirvu This PR is ready for review.

@mpirvu mpirvu self-assigned this Nov 25, 2021
@mpirvu mpirvu added the comp:jitserver Artifacts related to JIT-as-a-Service project label Nov 25, 2021
@mpirvu mpirvu added this to In progress in JIT as a Service via automation Nov 25, 2021
@AlexeyKhrabrov
Copy link
Contributor Author

Added AOT cache statistics.

@AlexeyKhrabrov AlexeyKhrabrov force-pushed the jitserver_aotcache_load branch 2 times, most recently from 48f90a7 to b25ef0f Compare November 25, 2021 23:15
Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please see the inline comments/questions.

runtime/compiler/control/J9Options.cpp Outdated Show resolved Hide resolved
runtime/compiler/control/rossa.cpp Show resolved Hide resolved
runtime/compiler/net/MessageTypes.hpp Outdated Show resolved Hide resolved
@mpirvu
Copy link
Contributor

mpirvu commented Nov 26, 2021

jenkins compile all jdk8

Since ROMClass sharing is beneficial in the same scenarios as the
AOT cache (multiple client JVMs), it should be enabled by default.

Signed-off-by: Alexey Khrabrov <khrabrov@cs.toronto.edu>
This commit adds the code to serve serialized methods from the JITServer
AOT cache in response to AOT compilation requests and load these methods
at the client after deserializing them and storing in the local SCC.

If the AOT deserialization or load fails, the next attempt to compile
the method will bypass the JITServer AOT cache.

AOT serialization record IDs newly added to the client's cache during
deserialization are sent to the server with subsequent compilation
requests and are saved in the client session at the server.

Signed-off-by: Alexey Khrabrov <khrabrov@cs.toronto.edu>
Signed-off-by: Alexey Khrabrov <khrabrov@cs.toronto.edu>
Signed-off-by: Alexey Khrabrov <khrabrov@cs.toronto.edu>
Signed-off-by: Alexey Khrabrov <khrabrov@cs.toronto.edu>
Signed-off-by: Alexey Khrabrov <khrabrov@cs.toronto.edu>
Signed-off-by: Alexey Khrabrov <khrabrov@cs.toronto.edu>
The printing of statistics can be enabled by setting the
environment variable TR_PrintJITServerAOTCacheStats.

Signed-off-by: Alexey Khrabrov <khrabrov@cs.toronto.edu>
Signed-off-by: Alexey Khrabrov <khrabrov@cs.toronto.edu>
@AlexeyKhrabrov
Copy link
Contributor Author

I've addressed the comments.

The 32-bit Windows build in the tests https://openj9-jenkins.osuosl.org/job/PullRequest-OpenJ9/1255/ is failing with an error unrelated to this PR: https://openj9-jenkins.osuosl.org/job/Build_JDK8_x86-32_windows_Personal/132/

21:36:51  F:\Users\jenkins\workspace\Build_JDK8_x86-32_windows_Personal\openj9\runtime\compiler\runtime\SignalHandler.c(401) : error C2220: warning treated as error - no 'object' file generated
21:36:51  F:\Users\jenkins\workspace\Build_JDK8_x86-32_windows_Personal\openj9\runtime\compiler\runtime\SignalHandler.c(401) : warning C4133: 'function' : incompatible types - from 'J9JavaVM *' to 'J9VMThread *'
21:36:51  make[4]: *** [runtime/compiler/CMakeFiles/j9jit.dir/build.make:4086: runtime/compiler/CMakeFiles/j9jit.dir/runtime/SignalHandler.c.obj] Error 2

The aix build seems to be stuck.

@mpirvu
Copy link
Contributor

mpirvu commented Nov 26, 2021

jenkins test sanity xlinuxjit zlinuxjit jdk11

@mpirvu
Copy link
Contributor

mpirvu commented Nov 26, 2021

jenkins test sanity xlinuxjit,zlinuxjit jdk11

@pshipton
Copy link
Member

I reverted the problematic PR causing the win32 build failure last night.

@mpirvu
Copy link
Contributor

mpirvu commented Nov 26, 2021

https://openj9-jenkins.osuosl.org/job/PullRequest-OpenJ9/1257/
Tests on zlinux passed.
Tests on xlinux failed due to infra as far as I can tell:

[Pipeline] nodesByLabel
05:20:23  Found a total of 20 nodes with the 'ci.role.test&&hw.arch.x86&&sw.os.linux' label
[Pipeline] echo
05:20:23  machine limit is 20
[Pipeline] timeout
05:20:23  Timeout set to expire in 1 hr 0 min
[Pipeline] {
[Pipeline] copyArtifacts
[Pipeline] }
[Pipeline] // timeout
[Pipeline] echo
05:20:54  Cannot get cached TRSS JSON data. Skipping copyArtifacts...
[Pipeline] timeout
05:20:54  Timeout set to expire in 2 hr 0 min
[Pipeline] {
[Pipeline] copyArtifacts
[Pipeline] }
[Pipeline] // timeout
[Pipeline] echo
07:06:02  Cannot run copyArtifacts from test.getDependency. Skipping copyArtifacts...
[Pipeline] sh
07:06:02  cent7-x64-5 was marked offline: Timed out for last 5 attempts
[Pipeline] }
[Pipeline] // timestamps
[Pipeline] }
[Pipeline] // stage
[Pipeline] echo
terminateJavaProcesses iteration: 1
[Pipeline] echo
PROCESSCATCH: Checking for any leftover java processes on the machine
[Pipeline] sh
cent7-x64-5 was marked offline: Timed out for last 5 attempts
[Pipeline] }
[Pipeline] // timeout
[Pipeline] echo
Exception: java.io.IOException: Unable to create live FilePath for cent7-x64-5
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // stage
[Pipeline] End of Pipeline
Finished: FAILURE

@mpirvu
Copy link
Contributor

mpirvu commented Nov 26, 2021

jenkins test sanity xlinuxjit jdk11

@mpirvu mpirvu merged commit ea06f74 into eclipse-openj9:master Nov 27, 2021
JIT as a Service automation moved this from In progress to Done Nov 27, 2021
@AlexeyKhrabrov AlexeyKhrabrov deleted the jitserver_aotcache_load branch November 27, 2021 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:jitserver Artifacts related to JIT-as-a-Service project
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants