-
Notifications
You must be signed in to change notification settings - Fork 156
Speed up host-arm workflow via native execution on Arm64 runners #318
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
base: master
Are you sure you want to change the base?
Conversation
The original build system automatically uses qemu-arm to run the compiler when targeting Arm32 if the native environment is not armv7l. However, modern Linux distributions typically enable CONFIG_COMPAT, which allows a 64-bit system to execute 32-bit binaries directly without any emulator. Therefore, this commit updates the build system to allow such native execution.
Since the build system has been updated to allow native execution on AArch64 when targeting Arm32, this commit improves the workflow definitions by running the "host-arm" job on Arm64 runners to perform validation. As a result of these changes, the "host-arm" job no longer uses "run-on-arch-action".
|
By the way, I have another branch, The commit and the test results are provided as follows: In summary, although using |
| @@ -1,4 +1,4 @@ | |||
| ARCH_NAME = armv7l | |||
| ARCH_NAME = armv7l aarch64 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is confusing. Not all Arm64 machines support the A32 ISA; therefore, the supported instruction sets must be validated explicitly, without assuming that Arm64 implies Arm32 compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After further investigation, it appears that there is no way to validate whether a machine supports the A32 ISA using shell commands.
Therefore, I would like to propose an altenative approach: introducing a new variable, FORCE_NATIVE, to control whether native execution should be enforced. For example:
$ make # Let the build system automatically determine the proper way to run
$ make FORCE_NATIVE=1 # Enforce native executionBy default, the build system performs native execution only when the machine architecture is armv7l; otherwise, QEMU is used to run the generated executables. However, if a user has confirmed that their machine can use native execution, they can manually set FORCE_NATIVE=1 to enforce it.
For Arm64 runners, I found a reference on the Arm Developer website. Although GitHub's official documentation does not describe the hardware details of Arm64 runners, the referenced page states:
Arm-hosted runners are powered by Cobalt 100 processors, based on the Arm Neoverse N2. The free runners have 4 vCPUs and Armv9-A features including Scalable Vector Extension 2 (SVE2).
From this information, we can conclude that GitHub's Arm64 runners use Arm Neoverse N2 processors to run workflows on VMs. According to the Arm Neoverse N2 specifications, the supported ISAs explicitly include A32.
Thus, if the proposed FORCE_NATIVE approach is acceptable, we can directly add a workflow step to run make FORCE_NATIVE=1, allowing native execution on Arm64 runners. As a result, the speedup can still be achieved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The above description represents my initial view. I can research further and provide more information if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can introduce an allow list of machines with verified A32 support, eliminating the need for the manual FORCE_NATIVE option.
The proposed changes modify the build system to allow native execution on AArch64 when targeting Arm32, and update the workflow definitions for
host-armto use Arm64 runners and perform native bootstrapping and other validations.Advantages
The original workflow of
host-armusesrun-on-arch-actionto validate whether bootstrapping and test cases run successfully. However, this job often takes a long time (6 ~ 8 minutes) because it relies on QEMU(*) to perform the build and run the test cases.(*) If I understand correctly,
run-on-arch-actionactually usesqemu-systemto execute the specified commands, which makes the emulation slow.After applying the proposed changes, the job can be sped up via native execution on Arm64 runners. According to the results,
host-armcan complete bootstrapping and test case validations within 2 minutes.As a result, the workflow is noticeably faster.
Summary by cubic
Run the host-arm workflow natively on Arm64 runners by enabling Arm32 execution on AArch64. This removes QEMU emulation and cuts the job from ~6–8 minutes to ~2 minutes.
Written for commit 47f6100. Summary will update on new commits.