0.6.0 • Published 2 months ago

@specs-feup/hoopa v0.6.0

Weekly downloads
-
License
-
Repository
github
Last release
2 months ago

hoopa

Hoopa (Holistic optimization and partitioning algorithms) is an extension to the Clava C/C++ to C/C++ source-to-source compiler that takes in any C/C++ application and finds code regions suitable for FPGA offloading. Besides providing basic partitioning algorithms, Hoopa also proposes and implements a novel algorithm that selects a region by considering both the partitioning decisions (e.g., CPU-FPGA communication costs, FPGA resources) and the optimizations performed over the FPGA code (e.g., streaming, pipelining).

How to install

This package is available on NPM. Assuming you already have a Clava-based NPM project setup, you can install the latest stable release with:

npm install @specs-feup/hoopa@latest

If you want to use unstable and experimental features, use the staging or nightly tags instead, as they are both built using the most recent commit in the repository. Nightly builds are built automatically every day, while staging builds are built on-demand:

npm install @specs-feup/hoopa@nightly

Partitoning algorithms

Hoopa is still in very early development, and so far we only provide two basic policies:

Offloading user-defined tasks

import { HoopaAlgorithm, HoopaConfig, OffloadingBackend } from "@specs-feup/hoopa/HoopaAlgorithm";
import { HoopaAPI } from "@specs-feup/hoopa/HoopaAPI";
import { PredefinedTasksConfig } from "@specs-feup/hoopa/PredefinedTasksConfig";

const config: HoopaConfig = {
    decorators: [],
    backends: [OffloadingBackend.XRT],
    algorithm: {
        name: HoopaAlgorithm.PREDEFINED_TASKS,
        taskNames: ["convolve2d_rep2", "combthreshold"]
    } as PredefinedTasksConfig,
    target: "targets/ZCU102.yaml"
};

const hoopa = new HoopaAPI("edge_detect", config, "outputs/s40", "edgedetect");
hoopa.runFromStart(false);

Offloading the task with the highest latency

import { HoopaAlgorithm, HoopaConfig, OffloadingBackend, TaskGraphDecorator } from "@specs-feup/hoopa/HoopaAlgorithm";
import { HoopaAPI } from "@specs-feup/hoopa/HoopaAPI";

const config: HoopaConfig = {
    decorators: [TaskGraphDecorator.VITIS_HLS],
    backends: [OffloadingBackend.XRT],
    algorithm: {
        name: HoopaAlgorithm.SINGLE_HOTSPOT
    },
    target: "targets/ZCU102.yaml"
};

const hoopa = new HoopaAPI("edge_detect", config, "outputs/s41", "edgedetect");
hoopa.runFromStart(false);