-
Notifications
You must be signed in to change notification settings - Fork 25
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
Support LLVM large code model #1091
Comments
This is a task that either Adel or TJ can look at.
|
Hi all, roadrunner/source/llvm/LLJit.cpp Line 96 in 8082940
On the JTMB various options can be set such as the optimization strategy in the code generation. The possible options are as seen here
We would need an option to set CodeModel::Large here (most likely there is no large speed penalty for that so this could also be the default for roadrunner). The code model can be set via
I.e. the only thing to do here is to add the line
and support the additional option via the roadrunner options. It would be great if someone could implement this fix, because we can't run our simulations at the moment without the option. Best Matthias |
Hi all, it would be great if this could be implemented. If you need any support with that let me know. I basically know what has to be done, but would need a core developer to help with this. Best Matthias |
I think Adel will take a look at it.
Herbert
|
Hi Mathias, I just saw your solution for this issue. Implementing it does make sense to me, but I believe setting the CodeModel to 'large' as the default value may have some consequences on roadrunner performance; let's keep it as our last resort. Instead, I have made some changes into our llvm13.x code based on a proposed patch. As I am not able to reproduce your error, I couldn't test it to see if it works. You can now re-build llvm dependency on your system using https://github.com/sys-bio/llvm-13.x/tree/Win64CallCheckStackLLVMTrunk branch. Let me know about the outcome. Adel |
Hi @adelhpour, I used your branch for compiling roadrunner /zhome/academic/HLRS/isd/isdsg/llvm_test/llvm-13.x
But the error is still the same, febio3: /zhome/academic/HLRS/isd/isdsg/llvm_test/llvm-13.x/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:319: Of course I'm not sure if you don't have to change something in roadrunner itself, as I said I only changed the llvm dependency. If you need more information please let me know. best regards, Steffen |
Hi Steffen, Now that this didn't work for you, I just set the default value of CodeModel to "large" in roadrunner so that you can use it on your system. We need to check if setting it into large as the default value have performance consequences before merging it into the develop branch. Here is the link to the updated branch that you can now use: Simply build this branch instead of the develop branch. No further configuration is required. Let me know if it worked for you so that we can start checking its impact on roadrunner performance. Regards, |
It's actually already built, if you want to use the pipeline artifacts: |
OK, the best guess from the LLVM people is that the large models are not, in fact, on. The assert error you are getting is designed, at least, to fire when you have small models and not large ones. Also suggested was Compiler Explorer, cf https://godbolt.org/z/84qWbr71d |
Could you have a look at my suggested solution above in this thread?I
linked the code before where I think you have to activate the code model
for roadrunner.
…On Sat, May 13, 2023, 05:40 Lucian Smith ***@***.***> wrote:
OK, the best guess from the LLVM people is that the large models are not,
in fact, on. The assert error you are getting is designed, at least, to
fire when you have small models and not large ones.
https://discourse.llvm.org/t/getting-assert-error-due-to-32-64-bit-issues-but-on-a-64-bit-os-in-runtimedyldelf-resolvex86-64relocation/70595/4
Also suggested was Compiler Explorer, cf https://godbolt.org/z/84qWbr71d
—
Reply to this email directly, view it on GitHub
<#1091 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAG33ORQCSJVGBRHQ723ERDXF37EDANCNFSM6AAAAAAWFJK6JQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Steffen and I tested setting the value of code model to large as in: Also, I set the getCodeModel function return value in such a way that it always returns llvm::CodeModel::Large as in: One possible solution to figure out if it is an actual "memory size" problem is that you use a larger/smaller number of roadrunner instances and run it on a machine with larger/smaller memory capacity. Then, you could check at what number of roadrunner instances the error starts to show up and if that number scales up/down relatively to the number you usually get on your current machine, and if that sounds logical based on the memory capacity increase/decrease. |
Hi all,
we the following issue when running hundreds to thousands of roadrunner instances in C++ at the same time on some cluster. The roadrunner instances are part of a large FEM simulation calculating ODEs on different mesh points.
The runtime error is
Probably the same issue discussed here:
https://lists.llvm.org/pipermail/llvm-dev/2015-May/085793.html
As I understand the issue problems arise because LLVM has a 2GB limit by default for memory relocation. To be safe during JIT the medium or large model should be used!
See here
https://stackoverflow.com/questions/40493448/what-does-the-codemodel-in-clang-llvm-refer-to
So in short because we have a large application with many instances we require more than 2GB of memory so not all memory addresses can be resolved relative any more.
The code model seems to be part of the LLVM CodeGen options:
https://clang.llvm.org/doxygen/classclang_1_1CodeGenOptions.html
It would be great if the option could be supported/enabled by default by roadrunner in the code generation. I am not sure how we could otherwise fix the issue.
Best Matthias
The text was updated successfully, but these errors were encountered: