mirror of
https://github.com/tig-pool-nk/tig-monorepo.git
synced 2026-02-21 18:57:21 +08:00
| .. | ||
| scripts | ||
| src | ||
| Cargo.toml | ||
| README.md | ||
tig-binary
A Rust crate that wraps an algorithm from tig-algorithm for compilation into a shared object.
TIG uses a forked version of LLVM compiler for injecting runtime signature and fuel tracking into the shared object.
For CUDA, TIG uses nvcc to generate ptx using target version sm_70/compute_70, before injecting runtime signature and fuel tracking into the ptx file.
Getting Started
- Run the development docker image for your challenge. Example:
# clone this repo
cd tig-monorepo
CHALLENGE=knapsack
VERSION=0.0.1
docker run -it -v $(pwd):/app ghcr.io/tig-foundation/tig-monorepo/$CHALLENGE/dev:$VERSION
- Build shared object using
build_algorithmscript:
- Expects
tig_algorithm::<CHALLENGE>::<ALGORITHM>::solve_challengeto be importable - Outputs to
tig-algorithms/lib/<CHALLENGE>/<ARCH>/<ALGORITHM>.so, whereARCHis arm64 or amd64 CHALLENGEis determined by your docker image
build_algorithm $ALGORITHM
Notes:
- To specifically build the shared object, you can use
build_soscript which is onPATH - To specifically build the ptx, you can use
build_ptxscript which is onPATH- Expects
tig_algorithm/src/<CHALLENGE>/<ALGORITHM>.cuortig_algorithm/src/<CHALLENGE>/<ALGORITHM>/benchmarker_outbound.cufile to exist - Outputs to
tig-algorithms/lib/<CHALLENGE>/ptx/<ALGORITHM>.ptx
- Expects
- To test your binary, you can use
test_algorithmscript which is onPATH. Example:build_algorithm sat_global_opt test_algorithm sat_global_opt [1000,300]
Complete Example
git clone https://github.com/tig-foundation/tig-monorepo -b test/satisfiability/sat_global_opt
cd tig-monorepo
CHALLENGE=satisfiability
VERSION=0.0.1
docker run -it -v $(pwd):/app ghcr.io/tig-foundation/tig-monorepo/$CHALLENGE/dev:$VERSION
# inside docker
build_algorithm sat_global_opt
test_algorithm sat_global_opt [1000,300]