Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into ianayl/2way-prefetch
  • Loading branch information
ianayl committed Dec 13, 2024
2 parents 260322e + b5f4a93 commit 65ca774
Show file tree
Hide file tree
Showing 41 changed files with 576 additions and 108 deletions.
2 changes: 1 addition & 1 deletion .github/docker/install_dpcpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ if [ "${SKIP_DPCPP_BUILD}" ]; then
fi

mkdir -p ${DPCPP_PATH}/dpcpp_compiler
wget -O ${DPCPP_PATH}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-09-27/sycl_linux.tar.gz
wget -O ${DPCPP_PATH}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
tar -xvf ${DPCPP_PATH}/dpcpp_compiler.tar.gz -C ${DPCPP_PATH}/dpcpp_compiler
16 changes: 15 additions & 1 deletion .github/workflows/benchmarks-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,25 @@ jobs:
- name: Build UMF
run: cmake --build ${{github.workspace}}/umf_build -j $(nproc)

- name: Compute core range
run: |
# Compute the core range for the first NUMA node, skipping the first 4 cores.
# This is to avoid the first cores that the kernel is likely to schedule more work on.
CORES=$(lscpu | awk '
/NUMA node0 CPU|On-line CPU/ {line=$0}
END {
split(line, a, " ")
split(a[4], b, ",")
sub(/^0/, "4", b[1])
print b[1]
}')
echo "CORES=$CORES" >> $GITHUB_ENV
- name: Run benchmarks
working-directory: ${{ github.workspace }}/ur-repo/
id: benchmarks
run: >
numactl -N 0 ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
taskset -c ${{ env.CORES }} ${{ github.workspace }}/ur-repo/scripts/benchmarks/main.py
~/bench_workdir
--sycl ${{ github.workspace }}/sycl_build
--ur ${{ github.workspace }}/ur_install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-fuzz-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Download DPC++
run: |
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
mkdir dpcpp_compiler
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-hw-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:

- name: Download DPC++
run: |
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
mkdir dpcpp_compiler
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt install libncurses5
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-09-27/sycl_linux.tar.gz
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
mkdir -p ${{github.workspace}}/dpcpp_compiler
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C ${{github.workspace}}/dpcpp_compiler
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/multi_device.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- name: Download DPC++
run: |
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-01-29/sycl_linux.tar.gz
wget -O ${{github.workspace}}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2024-12-12/sycl_linux.tar.gz
mkdir dpcpp_compiler
tar -xvf ${{github.workspace}}/dpcpp_compiler.tar.gz -C dpcpp_compiler
Expand Down
1 change: 1 addition & 0 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -8563,6 +8563,7 @@ urCommandBufferReleaseExp(
/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `NULL == hCommandBuffer`
/// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
/// - ::UR_RESULT_ERROR_INVALID_OPERATION - "If `hCommandBuffer` has already been finalized"
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
UR_APIEXPORT ur_result_t UR_APICALL
Expand Down
9 changes: 8 additions & 1 deletion scripts/benchmarks/benches/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
import tarfile

class Benchmark:
def __init__(self, directory):
def __init__(self, directory, suite):
self.directory = directory
self.suite = suite

@staticmethod
def get_adapter_full_path():
Expand Down Expand Up @@ -74,9 +75,15 @@ def teardown(self):
def stddev_threshold(self):
return None

def get_suite_name(self) -> str:
return self.suite.name()

class Suite:
def benchmarks(self) -> list[Benchmark]:
raise NotImplementedError()

def name(self) -> str:
raise NotImplementedError()

def setup(self):
return
5 changes: 4 additions & 1 deletion scripts/benchmarks/benches/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class ComputeBench(Suite):
def __init__(self, directory):
self.directory = directory

def name(self) -> str:
return "Compute Benchmarks"

def setup(self):
if options.sycl is None:
return
Expand Down Expand Up @@ -90,10 +93,10 @@ def parse_unit_type(compute_unit):

class ComputeBenchmark(Benchmark):
def __init__(self, bench, name, test):
super().__init__(bench.directory, bench)
self.bench = bench
self.bench_name = name
self.test = test
super().__init__(bench.directory)

def bin_args(self) -> list[str]:
return []
Expand Down
5 changes: 4 additions & 1 deletion scripts/benchmarks/benches/llamacpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ def __init__(self, directory):

self.directory = directory

def name(self) -> str:
return "llama.cpp bench"

def setup(self):
if options.sycl is None:
return
Expand Down Expand Up @@ -64,8 +67,8 @@ def benchmarks(self) -> list[Benchmark]:

class LlamaBench(Benchmark):
def __init__(self, bench):
super().__init__(bench.directory, bench)
self.bench = bench
super().__init__(bench.directory)

def setup(self):
self.benchmark_bin = os.path.join(self.bench.build_path, 'bin', 'llama-bench')
Expand Down
3 changes: 2 additions & 1 deletion scripts/benchmarks/benches/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ class Result:
# values below should not be set by the benchmark
name: str = ""
lower_is_better: bool = True
git_hash: str = ''
git_hash: str = ""
date: Optional[datetime] = None
suite: str = ""

@dataclass_json
@dataclass
Expand Down
5 changes: 4 additions & 1 deletion scripts/benchmarks/benches/syclbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ def __init__(self, directory):
self.directory = directory
return

def name(self) -> str:
return "SYCL-Bench"

def setup(self):
if options.sycl is None:
return
Expand Down Expand Up @@ -87,11 +90,11 @@ def benchmarks(self) -> list[Benchmark]:

class SyclBenchmark(Benchmark):
def __init__(self, bench, name, test):
super().__init__(bench.directory, bench)
self.bench = bench
self.bench_name = name
self.test = test
self.done = False
super().__init__(bench.directory)

def bin_args(self) -> list[str]:
return []
Expand Down
9 changes: 6 additions & 3 deletions scripts/benchmarks/benches/umf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ def __init__(self, directory):
self.directory = directory
if not isUMFAvailable():
print("UMF not provided. Related benchmarks will not run")


def name(self) -> str:
return "UMF"

def setup(self):
if not isUMFAvailable():
return []
Expand All @@ -40,6 +43,8 @@ def benchmarks(self) -> list[Benchmark]:

class ComputeUMFBenchmark(Benchmark):
def __init__(self, bench, name):
super().__init__(bench.directory, bench)

self.bench = bench
self.bench_name = name
self.oneapi = get_oneapi()
Expand All @@ -52,8 +57,6 @@ def __init__(self, bench, name):

self.col_statistics_time = None

super().__init__(bench.directory)

def bin_args(self) -> list[str]:
return []

Expand Down
5 changes: 4 additions & 1 deletion scripts/benchmarks/benches/velocity.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ def __init__(self, directory):

self.directory = directory

def name(self) -> str:
return "Velocity Bench"

def setup(self):
if options.sycl is None:
return
Expand All @@ -46,7 +49,7 @@ def benchmarks(self) -> list[Benchmark]:

class VelocityBase(Benchmark):
def __init__(self, name: str, bin_name: str, vb: VelocityBench, unit: str):
super().__init__(vb.directory)
super().__init__(vb.directory, vb)
self.vb = vb
self.bench_name = name
self.bin_name = bin_name
Expand Down
1 change: 1 addition & 0 deletions scripts/benchmarks/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def run_iterations(benchmark: Benchmark, env_vars, iters: int, results: dict[str

bench_result.name = bench_result.label
bench_result.lower_is_better = benchmark.lower_is_better()
bench_result.suite = benchmark.get_suite_name()

if bench_result.label not in results:
results[bench_result.label] = []
Expand Down
Loading

0 comments on commit 65ca774

Please sign in to comment.