Skip to content

Commit

Permalink
Merge branch 'develop' into mergeback-6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lawruble13 authored Aug 2, 2024
2 parents e7154bd + f3a8622 commit ebc9530
Show file tree
Hide file tree
Showing 11 changed files with 177 additions and 11 deletions.
44 changes: 44 additions & 0 deletions .azuredevops/rocm-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
resources:
repositories:
- repository: pipelines_repo
type: github
endpoint: ROCm
name: ROCm/ROCm

variables:
- group: common
- template: /.azuredevops/variables-global.yml@pipelines_repo

trigger:
batch: true
branches:
include:
- develop
paths:
exclude:
- .githooks
- .github
- .jenkins
- docs
- '.*.y*ml'
- '*.md'
- LICENSE.txt

pr:
autoCancel: true
branches:
include:
- develop
paths:
exclude:
- .githooks
- .github
- .jenkins
- docs
- '.*.y*ml'
- '*.md'
- LICENSE.txt
drafts: false

jobs:
- template: ${{ variables.CI_COMPONENT_PATH }}/rocRAND.yml@pipelines_repo
74 changes: 74 additions & 0 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Check Clang-Format on Diff

on: [pull_request]

jobs:
clang-format:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Import LLVM GPG Key
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 15CF4D18AF4F7421
- name: Add LLVM Repository
run: |
sudo add-apt-repository "deb http://apt.llvm.org/jammy llvm-toolchain-jammy-17 main"
sudo apt-get update
- name: Install clang-format 17
run: |
sudo apt-get install clang-format-17
- name: Fetch branches to check
run: |
git fetch origin ${{ github.base_ref }}
if [ "${{ github.repository_owner }}" != "${{ github.event.pull_request.head.repo.owner.login }}" ]; then
fork_owner="${{ github.event.pull_request.head.repo.owner.login }}"
fork_repo="${{ github.event.pull_request.head.repo.full_name }}"
echo "Fork repo: ${fork_repo}"
fork_url="https://github.com/${fork_repo}.git"
echo "Fork URL: ${fork_url}"
git remote add fork "${fork_url}"
git fetch fork ${{ github.head_ref }}
else
git fetch origin ${{ github.head_ref }}
fi
- name: Apply clang-format locally
if: github.event_name == 'pull_request'
run: |
if [ "${{ github.repository_owner }}" != "${{ github.event.pull_request.head.repo.owner.login }}" ]; then
./scripts/clang-format/clang-format-apply.sh origin/${{ github.base_ref }} fork/${{ github.head_ref }}
else
./scripts/clang-format/clang-format-apply.sh origin/${{ github.base_ref }} origin/${{ github.head_ref }}
fi
- name: Save clang-format changes as patch
run: |
git diff -U0
git diff -U0 > clang_format.patch
- name: Check if patch is not empty
run: |
if [ -s clang_format.patch ]; then
echo "Patch is not empty"
echo "patch_not_empty=true" >> $GITHUB_STATE
else
echo "Patch is empty"
echo "patch_not_empty=false" >> $GITHUB_STATE
fi
- name: Post patch as comment
if: env.GITHUB_STATE.patch_not_empty == 'true'
run: |
API_URL="https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.GH_ACTION_TOKEN_CLANG_FORMAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-d "{\"body\": \"clang-format has detected some changes that need formatting\"}" \
"${API_URL}"
13 changes: 11 additions & 2 deletions .jenkins/staticanalysis.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ ci: {
String urlJobName = auxiliary.getTopJobName(env.BUILD_URL)

properties(auxiliary.addCommonProperties([pipelineTriggers([cron('0 1 * * 6')])]))
stage(urlJobName) {
runCI([ubuntu20:['cpu']], urlJobName)

def jobNameList = ["main":([ubuntu22:['any']])]
jobNameList = auxiliary.appendJobNameList(jobNameList, 'rocBLAS')

jobNameList.each
{
jobName, nodeDetails->
if (urlJobName == jobName)
stage(jobName) {
runCI(nodeDetails, jobName)
}
}
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Documentation for rocRAND is available at
[https://rocm.docs.amd.com/projects/rocRAND/en/latest/](https://rocm.docs.amd.com/projects/rocRAND/en/latest/)

## (Unreleased) rocRAND-3.1.1 for ROCm 6.2.0

## Fixes
* Fixed " unknown extension ?>" issue in scripts/config-tuning/select_best_config.py
when using python version thats older than 3.11

## (Unreleased) rocRAND-3.1.0 for ROCm 6.2.0

### Additions
Expand Down
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ option(BUILD_ADDRESS_SANITIZER "Build with address sanitizer enabled" OFF)
option(CODE_COVERAGE "Build with code coverage flags (clang only)" OFF)
option(DEPENDENCIES_FORCE_DOWNLOAD "Don't search the system for dependencies, always download them" OFF)

# Install prefix
set(CMAKE_INSTALL_PREFIX "/opt/rocm" CACHE PATH "Install path prefix, prepended onto install directories")

# CMake modules
list(APPEND CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/cmake
Expand Down Expand Up @@ -90,9 +93,17 @@ endif()
set_property(CACHE GPU_TARGETS PROPERTY STRINGS "all")

if(GPU_TARGETS STREQUAL "all")
rocm_check_target_ids(DEFAULT_AMDGPU_TARGETS
TARGETS "gfx803;gfx900:xnack-;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102"
)
if(BUILD_ADDRESS_SANITIZER)
# ASAN builds require xnack
rocm_check_target_ids(DEFAULT_AMDGPU_TARGETS
TARGETS "gfx908:xnack+;gfx90a:xnack+;gfx940:xnack+;gfx941:xnack+;gfx942:xnack+"
)
else()
rocm_check_target_ids(DEFAULT_AMDGPU_TARGETS
TARGETS "gfx803;gfx900:xnack-;gfx906:xnack-;gfx908:xnack-;gfx90a:xnack-;gfx90a:xnack+;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200;gfx1201"
)
endif()

set(GPU_TARGETS "${DEFAULT_AMDGPU_TARGETS}" CACHE STRING "GPU architectures to compile for" FORCE)
endif()

Expand Down
2 changes: 1 addition & 1 deletion docs/sphinx/requirements.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
rocm-docs-core[api_reference]==1.4.0
rocm-docs-core[api_reference]==1.5.0
numpy
4 changes: 2 additions & 2 deletions docs/sphinx/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ beautifulsoup4==4.12.3
# via pydata-sphinx-theme
breathe==4.35.0
# via rocm-docs-core
certifi==2024.6.2
certifi==2024.7.4
# via requests
cffi==1.16.0
# via
Expand Down Expand Up @@ -114,7 +114,7 @@ requests==2.32.3
# via
# pygithub
# sphinx
rocm-docs-core[api-reference]==1.4.0
rocm-docs-core[api-reference]==1.5.0
# via -r requirements.in
smmap==5.0.1
# via gitdb
Expand Down
2 changes: 1 addition & 1 deletion library/src/rng/xorwow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class xorwow_generator_template : public generator_impl_base
m_engines_initialized = other.m_engines_initialized;
m_engines = other.m_engines;
m_start_engine_id = other.m_start_engine_id;
m_engines_size = other.m_engine_size;
m_engines_size = other.m_engines_size;
m_seed = other.m_seed;
m_poisson = std::move(other.m_poisson);

Expand Down
20 changes: 20 additions & 0 deletions scripts/clang-format/clang-format-apply.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

BASE_BRANCH=$1
CURRENT_BRANCH=$2

# Save unified diff with 0 context
git diff -U0 --name-only $BASE_BRANCH...$CURRENT_BRANCH > filestochange.diff

cat filestochange.diff

# Run clang-format in-place on .h and .cpp files
while IFS= read -r line; do
if [ -n "$line" ]; then
if [[ "$line" == *.h ]] || [[ "$line" == *.cpp ]]; then
clang-format -i "$line"
fi
fi
done < filestochange.diff

rm filestochange.diff
2 changes: 1 addition & 1 deletion scripts/config-tuning/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cycler==0.11.0
# via matplotlib
fonttools==4.43.0
# via matplotlib
jinja2==3.1.3
jinja2==3.1.4
# via -r requirements.in
json5==0.9.14
# via -r requirements.in
Expand Down
4 changes: 3 additions & 1 deletion scripts/config-tuning/select_best_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def guess_gcn_architecture(path: str, raw_json_data: dict):
gb_per_s_series.name = 'gb_per_s'

# Extract the groups of the regex match to a DataFrame
name_regex = r'^(?P<generator>\S+?)_(?P<distribution>uniform|normal|log_normal|poisson)_(?P<value_type>(?>unsigned_)?(?>int|short|char|long_long|float|half|double))_t(?P<block_size>\d+)_b(?P<grid_size>\d+)'

name_regex = r'^(?P<generator>\S+?)_(?P<distribution>uniform|normal|log_normal|poisson)_(?P<value_type>(unsigned_)?(int|short|char|long_long|float|half|double))_t(?P<block_size>\d+)_b(?P<grid_size>\d+)'

extracted_data = benchmark_data['name'].str.extract(name_regex)
extracted_data['block_size'] = extracted_data['block_size'].astype(int)
extracted_data['grid_size'] = extracted_data['grid_size'].astype(int)
Expand Down

0 comments on commit ebc9530

Please sign in to comment.