-
Notifications
You must be signed in to change notification settings - Fork 11
Alpha submission #48
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
Merged
Merged
Alpha submission #48
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
523297b
Alpha submission infrastructure and documentation
zakn-amd d3763d4
Merge branch 'master' into alpha_submission
zakn-amd 1d9de68
fix various minor typos
zakn-amd 79f36fe
Combine SHELL and update comment
eddieh-xlnx d016d18
Run test-container with GitHub Actions
eddieh-xlnx 2407ba7
Update .github/workflows/test-container.yml
eddieh-xlnx 1b7822c
fix typos in docs/alpha_submission
zakn-amd bd79337
Link to alpha_submission.html
eddieh-xlnx 3bb2178
small wording change
zakn-amd 8b4a245
Update docs/alpha_submission.md
eddieh-xlnx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved. | ||
# | ||
# Author: Eddie Hung, AMD | ||
# | ||
# SPDX-License-Identifier: MIT | ||
# | ||
|
||
name: test-container | ||
on: | ||
push: | ||
pull_request: | ||
jobs: | ||
test-container: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: 'recursive' | ||
- name: Setup Apptainer | ||
env: | ||
APPTAINER_VERSION: '1.2.5' | ||
run: | | ||
wget https://github.com/apptainer/apptainer/releases/download/v${APPTAINER_VERSION}/apptainer_${APPTAINER_VERSION}_amd64.deb | ||
sudo dpkg -i apptainer_${APPTAINER_VERSION}_amd64.deb || true | ||
sudo apt-get -f install | ||
- run: | | ||
make test-container | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: rwroute_container.sif | ||
path: | | ||
*.sif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,6 @@ build/ | |
*.dcp | ||
*.tcl | ||
*.wirelength | ||
*.sif | ||
wirelength_analyzer/test/data/ | ||
**/__pycache__/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Alpha Submission Containers | ||
|
||
This directory contains example [Apptainer](https://apptainer.org/docs/user/latest/) | ||
definition files that show how to containerize a router for submission. | ||
Contestants not building on top of RWRoute are required to provide a new file named `<router_name>_container.def` | ||
builds the environment for running their router. | ||
|
||
For further details on the alpha submission please refer to | ||
[this webpage](https://xilinx.github.io/fpga24_routing_contest/alpha_submission.html). | ||
|
||
The contents of this directory are as follows: | ||
|
||
* `rwroute_container.def` -- an example Apptainer definition file for `rwroute` | ||
* `nxroute-poc_container.def` -- an example Apptainer definition file for `nxroute-poc` (this is actually a link to `rwroute_container.def` since both routers require an identical environment) | ||
* `opencl_example/opencl_example_container.def` -- an example Apptainer definition file for a C++/OpenCL "Hello World" application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rwroute_container.def |
13 changes: 13 additions & 0 deletions
13
alpha_submission/opencl_example/opencl_example_container.def
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
BootStrap: docker | ||
From: ubuntu:20.04 | ||
|
||
%post | ||
apt-get -y update | ||
apt-get -y install ocl-icd-libopencl1 ocl-icd-opencl-dev opencl-headers git build-essential | ||
git clone https://github.com/cqcallaw/ocl-samples.git | ||
cd /ocl-samples | ||
make | ||
|
||
%runscript | ||
cd /ocl-samples/ | ||
./hello |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
BootStrap: docker | ||
From: eclipse-temurin:17 # Base image with Java VM 17 on Ubuntu | ||
|
||
%post | ||
# Install remaining system dependencies | ||
apt-get -y update | ||
apt-get -y install git python3 pip pkg-config libcapnp-dev time libtinfo5 | ||
# Create a mount point for Vivado | ||
mkdir /tools | ||
|
||
%environment | ||
# Add the host Vivado to the path | ||
export PATH=$PATH:/tools/Xilinx/Vivado/2022.2/bin/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
# Alpha Submission | ||
|
||
In order to ensure that the contest environment is able to support all router | ||
entries ahead of the final submission deadline, a mandatory step for continued | ||
participation in the contest is the submission of an early "alpha" release. | ||
The performance of this alpha submission will have **zero** effect on the | ||
final submission score; instead, the organizers will endeavour to work with | ||
contestants to ensure that the runtime environment is as desired. | ||
Contestants will receive private feedback from the organizers assessing the | ||
performance of just their router on the released benchmark suite (plus a hidden | ||
benchmark) when run on contest hardware. | ||
|
||
## Key Details | ||
|
||
* Alpha submission is mandatory for continued participation in the contest | ||
* Performance of alpha submissions will be shared privately with contestants and will not impact the final score | ||
* Alpha submissions will be evaluated on [AMD Heterogeneous Compute Cluster (HACC)](https://www.amd-haccs.io/) hardware | ||
* Contestants are required to use [Apptainer](https://apptainer.org/docs/user/latest/) to containerize their submission (details below) | ||
|
||
## Runtime Environment | ||
|
||
Aside from running under Linux without network access, no restrictions are | ||
placed on the languages, software dependencies, or runtime environment that | ||
contestants may use to implement their router. In order to enable this platform | ||
independence, contestants must containerize their router and runtime environment | ||
with the [Apptainer](https://apptainer.org/docs/user/latest/) framework. | ||
|
||
### Apptainer | ||
|
||
From the [Apptainer documentation](https://apptainer.org/docs/user/latest/introduction.html): | ||
> Apptainer is a container platform. It allows you to create and run containers that package up pieces of software in a way that is portable and reproducible. You can build a container using Apptainer on your laptop, and then run it on many of the largest HPC clusters in the world, local university or company clusters, a single server, in the cloud, or on a workstation down the hall. Your container is a single file, and you don’t have to worry about how to install all the software you need on each different operating system. | ||
|
||
Apptainer containers may be described with a `*.def` | ||
[definition file](https://apptainer.org/docs/user/latest/definition_files.html) | ||
that specifies the base operating system image, and any further customisations | ||
(such as library installations) required to support an application. A | ||
definition file can then be compiled into an executable `*.sif` image which | ||
allows the application to be run in an isolated environment. | ||
|
||
The [contest repository](https://github.com/Xilinx/fpga24_routing_contest/) | ||
has been updated with example `*.def` files in the `alpha_submission` directory | ||
for both `rwroute` and `nxroute-poc`. To build and run the default container | ||
(which on a fresh clone would be `rwroute`) one would just run: | ||
|
||
``` | ||
make run-container | ||
``` | ||
|
||
This is roughly equivalent to: | ||
``` | ||
apptainer build rwroute_container.sif alpha_submission/rwroute_container.def | ||
apptainer run --pid --home `pwd` --rocm --bind /etc/OpenCL --mount src=/tools/,dst=/tools/,ro rwroute_container.sif make | ||
``` | ||
|
||
The `apptainer build` command creates an image from the `rwroute_container.def` | ||
definition, and the `apptainer run` command runs this image. The Apptainer | ||
command line options do the following: | ||
|
||
* `--pid` runs the container in a new process ID namespace to ensure processes | ||
spawned by the container are not orphaned if the container is killed. | ||
* ``--home `pwd` `` sets the container home directory to be the current directory | ||
* `--rocm --bind /etc/OpenCL` configures [GPU Access](alpha_submission.md#gpu-access) | ||
* `--mount ...` creates a read-only mount of the host system's `/tools` | ||
directory to the container's `/tools` directory, which allows the container to | ||
access the host Vivado installation. | ||
|
||
The remainder of the Apptainer command line simply runs the default make target from inside the | ||
container. | ||
|
||
Finally, in order to aid in development the Makefile target: | ||
|
||
``` | ||
make test-container | ||
``` | ||
|
||
has also been provided. This target is identical to the `run-container` target, | ||
except that results are only collected for the `boom_med_pb` benchmark, instead | ||
of collecting results for every benchmark. This allows contestants to quickly | ||
test their Apptainer flow and avoid overloading shared resources should they | ||
be working on a shared cluster. | ||
|
||
For further information about working with Apptainer containers please refer to | ||
[the user documentation](https://apptainer.org/docs/user/latest/introduction.html). | ||
|
||
### GPU Access | ||
|
||
It is possible to access AMD GPU resources on the host from an Apptainer | ||
container. The directory `alpha_submission/opencl_example` contains a sample | ||
`*.def` file that builds a [C++/OpenCL "Hello World" example](https://github.com/cqcallaw/ocl-samples). | ||
To run this example: | ||
|
||
``` | ||
make run-opencl-example | ||
``` | ||
|
||
This `make` target builds a `*.sif` image from the | ||
`opencl_example_container.def` definition file and runs it with the command: | ||
|
||
``` | ||
apptainer run --pid --home `pwd` --rocm --bind /etc/OpenCL opencl_example_container.sif | ||
``` | ||
|
||
The `--rocm` switch enables AMD ROCm support in the container. The | ||
`--bind /etc/OpenCL` switch mounts the host OpenCL directory in the container, | ||
which is required to allow the containerized OpenCL stack to discover the host | ||
resources. | ||
|
||
Please note that contestants are free to use GPU interfaces other than OpenCL, | ||
such as [AMD HIP](https://github.com/ROCm-Developer-Tools/HIP). | ||
|
||
## Submission Format | ||
|
||
Contestants are required to submit a clone of the contest | ||
repository which has been modified to run their router in Apptainer. | ||
Specifically, organizers must be able to run the submitted router by calling only | ||
the `make run-container` target. By default, in a fresh checkout of the contest | ||
repository, this target will run `rwroute` in an Apptainer container. | ||
Thus in addition to their router contestants must supply a custom `*.def` file | ||
in the `alpha_submission` directory, as well as a Makefile that has been | ||
modified to run their router by default. To set the default router in the | ||
Makefile contestants must change the value of the `ROUTER` variable from | ||
`rwroute` to the name of their router. | ||
|
||
Starting from a clone of the contest repository that has already had its | ||
Makefile `ROUTER` variable modified such that `make` invokes the contestant | ||
router, one would just execute: | ||
|
||
``` | ||
make distclean-and-package-submission | ||
``` | ||
|
||
Which generates a submission artifact named | ||
`<router_name>_submission_<timestamp>.tar.gz` in the current directory. | ||
Internally, this executes the following commands: | ||
|
||
``` | ||
make distclean | ||
tar -czf ../<router_name>_submission_<timestamp>.tar.gz.tar.gz . | ||
mv ../<router_name>_submission_<timestamp>.tar.gz.tar.gz . | ||
``` | ||
|
||
Note that `make distclean` will delete all unrouted design files, routed | ||
results and logs, as well as the device description. The organizers will then | ||
evaluate the artifact with a process similar to the following: | ||
|
||
``` | ||
mkdir <router_name>_alpha_submission | ||
cd <router_name>_alpha_submission | ||
tar -xvf <router_name>_submission_<timestamp>.tar.gz | ||
make run-container | ||
``` | ||
|
||
### Closed-Source Submissions | ||
|
||
While contestants are strongly encouraged to open-source their solutions at the | ||
conclusion of the contest, there is no requirement to do so. In such cases, | ||
it is still necessary to use the flow described above to produce a binary only | ||
submission. That is, any precompiled router must still work inside Apptainer | ||
and be invoke-able using `make run-container` on the contest hardware. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.