Skip to content

Scheduler

Christopher Liu edited this page Sep 28, 2021 · 6 revisions

The scheduler could be found under util/scheduler.

Requirements

  • Python 3.8+
  • PyYAML

Generating a Heterogeneous Kernel

Subject to future change. I intend to add subparsers for each kernel. For the latest instructions, use python3 sched.py --help. An example usage could also be found in the Makefile in the directory.

BFS

Currently a work in progress.

Run python3 sched.py --algorithm bfs <benchmark YAML files>. The heterogeneous kernel will be emitted as bfs.cuh in the same directory.

Example

Micro-benchmark results .yaml files are copied into the results directory.

Sample Run:

$ python3 sched.py --algorithm bfs results/*.yaml
$ How many Intel i7-9700K?
$  >  1
$ How many NVIDIA Quadro RTX 4000?
$  >  1

The scheduler is given all the micro-benchmark results stored in the results directory. The scheduler will emit the schedule for a CPU + 1 GPU combo (for the CPU section, 0 indicates NO CPU and 1 indicates YES CPU; for the GPU section, the number represents the number of GPUs).

Move the emitted bfs.cuh heterogeneous kernel into src/kernels/heterogeneous.

mv bfs.cuh ../../src/kernels/heterogeneous

Advanced Configuration

For advanced configurations, you must edit util/scheduler/scheduler/kernelgen/bfs_hetero.py.

SSSP

Run python3 sched.py --algorithm sssp <benchmark YAML files>. The heterogeneous kernel will be emitted as sssp.cuh in the same directory.

Example

Micro-benchmark results .yaml files are copied into the results directory.

Sample Run:

$ python3 sched.py --algorithm sssp results/*.yaml
$ How many Intel i7-9700K?
$  >  1
$ How many NVIDIA Quadro RTX 4000?
$  >  1

The scheduler is given all the micro-benchmark results stored in the results directory. The scheduler will emit the schedule for a CPU + 1 GPU combo (for the CPU section, 0 indicates NO CPU and 1 indicates YES CPU; for the GPU section, the number represents the number of GPUs).

Move the emitted sssp.cuh heterogeneous kernel into src/kernels/heterogeneous.

mv sssp.cuh ../../src/kernels/heterogeneous

Advanced Configuration

For now, advanced configurations requires util/scheduler/scheduler/kernelgen/sssp_hetero.py to be edited.

Available options:

  • INTERLEAVE = {True, False}: Enable or disable compute and memory operation overlap. If True, memory communication if will be O(n^2); else, the butterfly transfer pattern will be performed with a communication cost of O(n logn).
  • HIGH_DEGREE_FIRST = {True, False}: Determines if segments should be computed from highest degree to lowest degree or vice versa.

Clone this wiki locally