Skip to content

Commit f4718dc

Browse files
committed
HIP support.
1 parent 4006294 commit f4718dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1036
-920
lines changed

.github/workflows/releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
LICENSE COPYING-hdf5 LICENSE-erfa LICENSE-cfitsio LICENSE-NVIDIA README.md \
6868
hyperdrive
6969
70-
cargo build --profile production --locked --no-default-features --features=hdf5-static,cfitsio-static,cuda-single
70+
cargo build --profile production --locked --no-default-features --features=hdf5-static,cfitsio-static,cuda,gpu-single
7171
mv target/production/hyperdrive .
7272
tar -acvf mwa_hyperdrive-$(git describe --tags)-Linux-x86-64-v3-CUDA-single.tar.gz \
7373
LICENSE COPYING-hdf5 LICENSE-erfa LICENSE-cfitsio LICENSE-NVIDIA README.md \

.github/workflows/run-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,7 @@ jobs:
8080
cargo clean
8181
cargo +${MIN_RUST} test --locked
8282
cargo +${MIN_RUST} test --locked --features=all-static
83-
cargo +${MIN_RUST} test --locked --all-features --no-run
83+
# Can't test with --all-features, cuda and hip aren't allowed together
84+
# hip is also difficult to install so ignore it
85+
cargo +${MIN_RUST} test --locked --features=all-static,cuda --no-run
86+
cargo +${MIN_RUST} test --locked --features=all-static,cuda,gpu-single --no-run

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).
88

99
## [0.3.0] - Unreleased
1010
### Added
11+
- Support for HIP, which allows AMD GPUs to be used instead of only NVIDIA GPUs
12+
via CUDA.
1113
- Support for the "DipAmps" column in a metafits file. This allows users to
1214
control dipole gains in beam code.
1315
- Support for averaging incoming visibilities in time and frequency *before*

Cargo.lock

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@ inherits = "production"
3030
default = ["plotting"]
3131

3232
# Use CUDA code with double-precision floats.
33-
cuda = ["mwa_hyperbeam/cuda", "cuda-runtime-sys"]
33+
cuda = ["mwa_hyperbeam/cuda", "cuda-runtime-sys", "cc"]
3434

35-
# Use CUDA code with single-precision floats.
36-
cuda-single = [
37-
"cuda",
38-
"mwa_hyperbeam/gpu-single",
39-
]
35+
# Use HIP code with double-precision floats.
36+
hip = ["mwa_hyperbeam/hip", "hip-sys", "cc"]
37+
38+
# Opt-out of GPU double precision, use only single precision (faster on desktop
39+
# GPUs).
40+
gpu-single = ["mwa_hyperbeam/gpu-single"]
4041

4142
# Enable plotting.
4243
plotting = ["plotters"]
@@ -100,6 +101,9 @@ vec1 = { version = "1.5.0", features = ["serde"] }
100101
# "cuda" feature
101102
cuda-runtime-sys = { version = "0.3.0-alpha.1", optional = true }
102103

104+
# "hip" feature
105+
hip-sys = { version = "0.1.0", optional = true }
106+
103107
# "plotting" feature
104108
plotters = { version = "0.3.5", default-features = false, features = [
105109
"bitmap_backend",
@@ -121,7 +125,8 @@ tempfile = "3.6.0"
121125

122126
[build-dependencies]
123127
built = { version = "0.6.0", features = ["chrono", "git2"] }
124-
cc = { version = "1.0.72", features = ["parallel"] }
128+
cc = { version = "1.0.72", features = ["parallel"], optional = true }
129+
hip-sys = { version = "0.1.0", optional = true }
125130

126131
[[bench]]
127132
name = "bench"

benches/bench.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn model_benchmarks(c: &mut Criterion) {
9292
);
9393
}
9494

95-
#[cfg(feature = "cuda")]
95+
#[cfg(any(feature = "cuda", feature = "hip"))]
9696
for (num_sources, num_chans) in [
9797
(1, 768),
9898
(32, 768),
@@ -130,7 +130,7 @@ fn model_benchmarks(c: &mut Criterion) {
130130
},
131131
);
132132
}
133-
let modeller = model::SkyModellerCuda::new(
133+
let modeller = model::SkyModellerGpu::new(
134134
&*beam,
135135
&source_list,
136136
Polarisations::default(),
@@ -209,7 +209,7 @@ fn model_benchmarks(c: &mut Criterion) {
209209
})
210210
});
211211

212-
#[cfg(feature = "cuda")]
212+
#[cfg(any(feature = "cuda", feature = "hip"))]
213213
for (num_sources, num_chans) in [
214214
(1, 768),
215215
(32, 768),
@@ -251,7 +251,7 @@ fn model_benchmarks(c: &mut Criterion) {
251251
},
252252
);
253253
}
254-
let modeller = model::SkyModellerCuda::new(
254+
let modeller = model::SkyModellerGpu::new(
255255
&*beam,
256256
&source_list,
257257
Polarisations::default(),
@@ -342,7 +342,7 @@ fn model_benchmarks(c: &mut Criterion) {
342342
},
343343
);
344344

345-
#[cfg(feature = "cuda")]
345+
#[cfg(any(feature = "cuda", feature = "hip"))]
346346
for (num_sources, num_chans) in [
347347
(1, 768),
348348
(32, 768),
@@ -393,7 +393,7 @@ fn model_benchmarks(c: &mut Criterion) {
393393
},
394394
);
395395
}
396-
let modeller = model::SkyModellerCuda::new(
396+
let modeller = model::SkyModellerGpu::new(
397397
&*beam,
398398
&source_list,
399399
Polarisations::default(),

0 commit comments

Comments
 (0)