-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #138 from NVIDIA/11.8.x-new-layout
Patch 11.8.4
- Loading branch information
Showing
112 changed files
with
38,860 additions
and
26,284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: cuda_python | ||
channels: | ||
- defaults | ||
dependencies: | ||
- python>=3.10 | ||
- cython>=3.0.0 | ||
- pytest>=6.2.4 | ||
- numpy>=1.21.1 | ||
- setuptools | ||
- wheel | ||
- pip | ||
- cuda-version=12.6 | ||
- cuda-cudart-static | ||
- cuda-driver-dev | ||
- cuda-cudart-dev | ||
- cuda-profiler-api | ||
- cuda-nvrtc-dev | ||
- cuda-nvcc | ||
- pip: | ||
- pytest-benchmark>=3.4.1 | ||
- pyclibrary>=0.1.7 | ||
- versioneer==0.29 | ||
- tomli; python_version < "3.11" | ||
- pywin32; sys_platform == 'win32' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "packages" : {} } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
build_ci() { | ||
set -xeou pipefail | ||
|
||
cd "${REPO_DIR}" | ||
|
||
export CUDA_HOME="${CONDA_PREFIX}/targets/x86_64-linux" | ||
export PARALLEL_LEVEL=$(nproc --ignore 1) | ||
|
||
python setup.py bdist_wheel | ||
} | ||
|
||
build_project() { | ||
set -xeou pipefail | ||
|
||
export PYTHONUNBUFFERED=1 | ||
|
||
. setup-utils; | ||
init_build_env "$@"; | ||
|
||
git config --global --add safe.directory "$REPO_DIR/.git" | ||
|
||
case "${BUILD_TYPE}" in | ||
ci) build_ci;; | ||
*) return 1;; | ||
esac | ||
} | ||
|
||
(build_project "$@"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
activate_conda_env() { | ||
set +xu | ||
eval "$(conda shell.bash hook)" | ||
conda activate "${CONDA_ENV}"; | ||
set -xu | ||
: ${PYTHON_VERSION:=$(python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")} | ||
export PYTHON_VERSION | ||
} | ||
|
||
conda_info() { | ||
set +x | ||
conda info | ||
set -x | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
set_initial_env() { | ||
set -xeuo pipefail | ||
|
||
export PATH="${PATH}:${REPO_DIR}/continuous_integration/scripts" | ||
} | ||
|
||
entrypoint() { | ||
set -xeuo pipefail | ||
set_initial_env; | ||
|
||
git config --global --add safe.directory "$REPO_DIR/.git" | ||
|
||
cd "${REPO_DIR}" | ||
|
||
exec "$@"; | ||
} | ||
|
||
entrypoint "$@"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x | ||
|
||
make_ci_env() { | ||
mamba env create -n "${CONDA_ENV}" -f "${REPO_DIR}/continuous_integration/environment.yml" | ||
} | ||
|
||
make_test_env() { | ||
. conda-utils | ||
|
||
mamba env create -n "${CONDA_ENV}" -f "${REPO_DIR}/continuous_integration/environment.yml" | ||
|
||
activate_conda_env | ||
|
||
pip install "${ARTIFACTS_DIR}"/*.whl | ||
|
||
} | ||
|
||
make_conda_env() { | ||
set -xeuo pipefail | ||
|
||
. setup-utils; | ||
set_base_defs; | ||
|
||
case "$1" in | ||
ci) make_ci_env;; | ||
test) make_test_env;; | ||
*) return 1;; | ||
esac | ||
|
||
return 0; | ||
} | ||
|
||
(make_conda_env "$@"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import argparse | ||
import json | ||
from jinja2 import Environment, FileSystemLoader | ||
import os | ||
import re | ||
|
||
# TODO: make this work for arbitrary context. ie. implement replace_using_context() | ||
def replace_placeholder(source_str, variable_name, variable_value): | ||
# Escaping any regex special characters in variable_name | ||
variable_name_escaped = re.escape(variable_name) | ||
|
||
# Using regular expression to replace ${variable_name} with actual variable_value | ||
# \s* means any amount of whitespace (including none) | ||
# pattern = rf'\$\{{\s*\{{\s*{variable_name_escaped}\s*\}}\s*\}}' | ||
pattern = rf'<<\s*{variable_name_escaped}\s*>>' | ||
return re.sub(pattern, variable_value.strip(), source_str) | ||
|
||
# Setup command-line argument parsing | ||
parser = argparse.ArgumentParser(description='Render a Jinja2 template using a JSON context.') | ||
parser.add_argument('template_file', type=str, help='Path to the Jinja2 template file (with .j2 extension).') | ||
parser.add_argument('json_file', type=str, help='Path to the JSON file to use as the rendering context.') | ||
parser.add_argument('output_file', type=str, help='Path to the output file.') | ||
|
||
args = parser.parse_args() | ||
|
||
# Load JSON file as the rendering context | ||
with open(args.json_file, 'r') as file: | ||
context = json.load(file) | ||
|
||
# Setup Jinja2 environment and load the template | ||
env = Environment( | ||
loader=FileSystemLoader(searchpath='./'), | ||
variable_start_string='<<', | ||
variable_end_string='>>', | ||
block_start_string='<%', | ||
block_end_string='%>', | ||
comment_start_string='<#', | ||
comment_end_string='#>') | ||
env.filters['replace_placeholder'] = replace_placeholder | ||
|
||
template = env.get_template(args.template_file) | ||
|
||
# Render the template with the context | ||
rendered_content = template.render(context) | ||
# print(rendered_content) | ||
|
||
with open(args.output_file, 'w') as file: | ||
file.write(rendered_content) | ||
|
||
print(f'Template rendered successfully. Output saved to {args.output_file}') |
Oops, something went wrong.