Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linting workflow from rocm-docs-core #143

Merged
merged 5 commits into from
Nov 3, 2023
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
12 changes: 12 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Linting

on:
push:
branches: [develop]
pull_request:
branches: [develop]

jobs:
call-workflow-passing-data:
name: Documentation
uses: RadeonOpenCompute/rocm-docs-core/.github/workflows/linting.yml@develop
4 changes: 4 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
config:
default: true
MD013: false
MD024: false
60 changes: 44 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
# hipTensor
hiptensor is AMD's C++ library for accelerating tensor primitives based on the composable kernel library, through general purpose kernel languages, like HIP C++.

hiptensor is AMD's C++ library for accelerating tensor primitives
based on the composable kernel library,
through general purpose kernel languages, like HIP C++.

## GPU Support
* AMD CDNA class GPU featuring matrix core support: gfx908, gfx90a, gfx940, gfx941, gfx942 as 'gfx9'

`Note: Double precision FP64 datatype support requires gfx90a, gfx940, gfx941 or gfx942`
* AMD CDNA class GPU featuring matrix core support:
gfx908, gfx90a, gfx940, gfx941, gfx942 as 'gfx9'

> Note: Double precision FP64 datatype support requires
> gfx90a, gfx940, gfx941 or gfx942

## Minimum Software Requirements

* ROCm stack minimum version 5.7
* ROCm-cmake minimum version 0.8.0 for ROCm 5.7
* C++ 17
* CMake >=3.6
* Composable Kernel

Optional:

* doxygen (for building documentation)

## Documentation

Run the steps below to build documentation locally.

```
```shell
cd docs

pip3 install -r .sphinx/requirements.txt
Expand All @@ -29,13 +37,16 @@ python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
```

## Currently supported

Operations - Contraction Tensor
Data Types - FP32 , FP64

## Contributing to the code

1. Create and track a hipTensor fork.
2. Clone your fork:
```

```shell
git clone -b develop https://github.com/<your_fork>/hipTensor.git .
.githooks/install
git checkout -b <new_branch>
Expand All @@ -45,22 +56,27 @@ git commit -m "What was changed"
git push origin <new_branch>
...
```

<!-- markdownlint-disable ol-prefix -->
3. Create a pull request to ROCmSoftwarePlatform/hipTensor develop branch.
4. Await CI and approval feedback.
5. Once approved, merge!
<!-- markdownlint-enable ol-prefix -->

`Note: Please don't forget to install the githooks as there are triggers for clang formatting in commits.`

## Build with CMake

### Project options

|Option|Description|Default Value|
|---|---|---|
|AMDGPU_TARGETS|Build code for specific GPU target(s)|gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942|
|HIPTENSOR_BUILD_TESTS|Build Tests|ON|
|HIPTENSOR_BUILD_SAMPLES|Build Samples|ON|

### Example configurations

By default, the project is configured as Release mode.
Here are some of the examples for the configuration:
|Configuration|Command|
Expand All @@ -72,43 +88,53 @@ Here are some of the examples for the configuration:

After configuration, build with `cmake --build <build_dir> -- -j<nproc>`

### Tips to reduce tests compile time:
- Target a specific GPU (e.g. gfx908:xnack-)
- Use lots of threads (e.g. -j64)
### Tips to reduce tests compile time

* Target a specific GPU (e.g. gfx908:xnack-)
* Use lots of threads (e.g. -j64)

## Running Unit Tests

### Logger tests

Tests API implementation of logger verbosity and functionality.
o <build_dir>/bin/logger_test
o <build_dir>/bin/logger_test

## Running Contraction Tests

### Bilinear contraction tests

Tests the API implementation of bilinear contraction algorithm with validation.
o <build_dir>/bin/bilinear_contraction_f32_test
o <build_dir>/bin/bilinear_contraction_f64_test
o <build_dir>/bin/bilinear_contraction_f32_test
o <build_dir>/bin/bilinear_contraction_f64_test

### Scale contraction tests

Tests the API implementation of scale contraction algorithm with validation.
o <build_dir>/bin/scale_contraction_f32_test
o <build_dir>/bin/scale_contraction_f64_test
o <build_dir>/bin/scale_contraction_f32_test
o <build_dir>/bin/scale_contraction_f64_test

### Samples

These are stand-alone use-cases of the hipTensor contraction operations.

## F32 Bilinear contraction

Demonstrates the API implementation of bilinear contraction operation without validation.
o <build_dir>/bin/simple_contraction_bilinear_f32
o <build_dir>/bin/simple_contraction_bilinear_f32

## F32 Scale contraction

Demonstrates the API implementation of scale contraction operation without validation.
o <build_dir>/bin/simple_contraction_scale_f32
o <build_dir>/bin/simple_contraction_scale_f32

### Build Samples as external client
Client application links to hipTensor library, and therefore hipTensor library needs to be installed before building client applications.

Client application links to hipTensor library,
and therefore hipTensor library needs to be installed before building client applications.

## Build

```bash
mkdir -p samples/build
cd samples/build
Expand All @@ -120,7 +146,9 @@ cmake
-D CMAKE_PREFIX_PATH="/opt/rocm;${PATH_TO_HIPTENSOR_INSTALL_DIRECTORY};${PATH_TO_CK_INSTALL_DIRECTORY} \
..
```

### Build client example

```bash
make
```
Loading