Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/build-reactantjll.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Build Reactant_jll"

on:
pull_request:
branches:
- main
paths:
- ".github/workflows/build-reactantjll.yml"
- "deps/ReactantExtra/API.cpp"
- "deps/ReactantExtra/BUILD"
- "deps/ReactantExtra/WORKSPACE"
- "deps/ReactantExtra/workspace.bzl"

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
enzyme-jax-commit:
name: Extract ENZYMEXLA_COMMIT from WORKSPACE
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Extract ENZYMEXLA_COMMIT from WORKSPACE
id: extract_enzyme_jax_commit
run: |
ENZYMEXLA_COMMIT=$(grep -oP 'ENZYMEXLA_COMMIT = "\K[^"]+' deps/ReactantExtra/WORKSPACE)
echo "enzyme_jax_commit=$ENZYMEXLA_COMMIT" >> $GITHUB_OUTPUT
outputs:
enzyme_jax_commit: ${{ steps.extract_enzyme_jax_commit.outputs.enzyme_jax_commit }}

build-jll:
name: Build Reactant_jll
if: github.event.pull_request.draft == false
uses: EnzymeAD/ReactantBuilder/.github/workflows/build-reactant-reusable.yml@main
needs: enzyme-jax-commit
with:
reactantbuilder_ref: "main"
reactant_commit: ${{ github.event.pull_request.head.sha }}
enzyme_jax_commit: ${{ needs.enzyme-jax-commit.outputs.enzyme_jax_commit }}
13 changes: 8 additions & 5 deletions deps/ReactantExtra/API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,9 @@ CudaGetStreamExecutorDeviceDescription(int32_t device_id) {

// Memory bandwidth (bytes/sec) ≈ 2 * memClock(Hz) * busWidth(bytes)
// props.memoryClockRate is in kHz; bus width is in bits.
const double mem_clock_hz =
static_cast<double>(props.memoryClockRate) * 1000.0;
const double mem_clock_hz = static_cast<double>(GetCudaIntegerAttribute(
cudaDevAttrMemoryClockRate, device_id)) *
1000.0;
const double bus_bytes = static_cast<double>(props.memoryBusWidth) / 8.0;
const double bandwidth_Bps = 2.0 * mem_clock_hz * bus_bytes; // DDR assumption
device_description->set_memory_bandwidth(
Expand All @@ -925,8 +926,10 @@ CudaGetStreamExecutorDeviceDescription(int32_t device_id) {
GetCudaIntegerAttribute(cudaDevAttrL2CacheSize, device_id));

// SM clock (GHz). props.clockRate is kHz.
device_description->set_clock_rate_ghz(static_cast<double>(props.clockRate) /
1.0e6);
device_description->set_clock_rate_ghz(
static_cast<double>(
GetCudaIntegerAttribute(cudaDevAttrClockRate, device_id)) /
1.0e6);
device_description->set_device_memory_size(props.totalGlobalMem);

// Registers
Expand Down Expand Up @@ -3480,7 +3483,7 @@ REACTANT_ABI void EstimateRunTimeForInstruction(

#else

REACTANT_ABI void *CreateGPUPerformanceModelWrapper(
REACTANT_ABI void *CreateGPUPerformanceModel(
MlirContext ctx, stream_executor::DeviceDescription *device_description) {
return nullptr;
}
Expand Down
Loading