Skip to content
Open
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
6 changes: 3 additions & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ omit =
tuna/corrupt_configs.py
tuna/data_migration_updated_layouts.py
tuna/export_configs.py
tuna/flask.py
tuna/flask_example.py
tuna/miopen/analyze_fdb.py
tuna/prune_db.py
tuna/query_db.py
Expand All @@ -17,10 +15,12 @@ omit =
tuna/utils/dupe_resolve.py
tuna/build_driver_cmd.py
tuna/solver_res.py
tuna/celery_app/celery_app.py
tuna/miopen/celery_tuning/celery_tasks.py

[report]
exclude_lines =
def __repr __
raise NotImplementedError
if __name__ == .__main__.:


2 changes: 1 addition & 1 deletion .jenkins/export_db
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pipeline {
string(name: 'db_name', defaultValue: ${TUNA_DB_NAME}, description: 'Name of the database schema')
string(name: 'db_user', defaultValue: ${JENKINS_USER}, description: 'Username for the databse')
string(name: 'db_password', defaultValue: ${JENKINS_PWD}, description: 'Password for the user')
string(name: 'docker_registry', defaultValue: '${headnode}:5000', description: 'Name of the docker registry for pushing images')
string(name: 'docker_registry', defaultValue: '${DOCKER_REGISTRY}', description: 'Name of the docker registry for pushing images')
}
stages {
stage("Check params")
Expand Down
30 changes: 15 additions & 15 deletions .jenkins/init_session
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,35 @@ echo "${util_lib}"
library "${util_lib}"

def initSession(){
backend = "HIPNOGPU"
backend = "HIP"
def tuna_docker
def tuna_docker_name = utils.getDockerName("HIPNOGPU")
def build_args = " --network host --build-arg ROCMVERSION=${params.rocm_version} --build-arg OSDB_BKC_VERSION=${params.osdb_bkc_version} --build-arg BACKEND=${backend} --build-arg MIOPEN_BRANCH=${miopen_branch_name} --build-arg DB_NAME=${params.db_name} --build-arg DB_USER_NAME=${db_user} --build-arg DB_USER_PASSWORD=${db_password} --build-arg DB_HOSTNAME=${db_host} --build-arg MIOPEN_USE_MLIR=${params.use_mlir}"
def tuna_docker_name = utils.getDockerName("HIP")
def build_args = " --network host --build-arg ROCMVERSION=${params.rocm_version} --build-arg OSDB_BKC_VERSION=${params.osdb_bkc_version} --build-arg BUILD_MIOPEN_DEPS=${params.build_miopen_deps} --build-arg BACKEND=${backend} --build-arg MIOPEN_BRANCH=${miopen_branch_name} --build-arg DB_NAME=${params.db_name} --build-arg DB_USER_NAME=${db_user} --build-arg DB_USER_PASSWORD=${db_password} --build-arg DB_HOSTNAME=${db_host} --build-arg MIOPEN_USE_MLIR=${params.use_mlir}"

if(params.base_image != '')
{
build_args = build_args + " --build-arg BASEIMAGE=${params.base_image} --build-arg ROCM_PRE=1"
build_args = build_args + " --build-arg BASEIMAGE=${params.base_image}"
}
if(params.arch != '')
{
build_args = build_args + " --build-arg ARCH_TARGET=${params.arch}"
}
sh "echo ${build_args}"

tuna_docker = docker.build("${tuna_docker_name}", "${build_args} ." )

def docker_run_args = "--network host --dns 8.8.8.8 --device=/dev/kfd --device /dev/dri:/dev/dri:rw --volume /dev/dri:/dev/dri:rw --group-add video -e TUNA_DB_HOSTNAME=${db_host} -e TUNA_DB_NAME=${params.db_name} -e TUNA_DB_USER_NAME=${db_user} -e TUNA_DB_PASSWORD=${db_password} -e gateway_ip=${gateway_ip} -e gateway_port=${gateway_port} -e gateway_user=${gateway_user} -e TUNA_LOGLEVEL=${params.tuna_loglevel}"

def num_session_prev = utils.runsql("SELECT count(*) from session where reason='${job_label}';")

if(params.arch != '' && params.num_cu != '')
{
def margs = "-a ${params.arch} -n ${params.num_cu}"
sh "docker run ${docker_run_args} ${tuna_docker_name} ./tuna/go_fish.py miopen --init_session -l ${job_label} ${margs}"
sh "docker run ${docker_args} ${tuna_docker_name} ./tuna/go_fish.py miopen --init_session -l ${job_label} ${margs} --docker_name ${base_image}"
tuna_docker.push()
}
else
{
tuna_docker.push()
sh "srun --no-kill -p ${slurm_partition} -N 1 -l bash -c 'docker run ${docker_run_args} ${tuna_docker_name} ./tuna/go_fish.py miopen --init_session -l ${job_label}'"
sh "srun --no-kill -p ${slurm_partition} -N 1 -l bash -c 'docker run ${docker_args} ${tuna_docker_name} ./tuna/go_fish.py miopen --init_session -l ${job_label} --docker_name ${base_image}'"
}

def num_session_now = utils.runsql("SELECT count(*) from session where reason='${job_label}';")
Expand All @@ -48,11 +51,6 @@ def initSession(){

def VerifyArgs()
{
if(params.rocm_version == '' && params.osdb_bkc_version == '')
{
error "Either ROCm version or OSDB build number is required"
}

if(params.rocm_version != '' && params.osdb_bkc_version != '')
{
error "Can only specify either the ROCm version or the OSDB build number"
Expand All @@ -65,13 +63,14 @@ def VerifyArgs()
}

pipeline {
agent { node { label 'mysql' } }
agent { node { label 'build-node' } }
environment {
db_name = "${params.db_name}"
db_host = "${params.db_host}"
db_user = "${params.db_user}"
db_password = "${params.db_password}"
branch_id = "${params.branch_name}_${BUILD_ID}"
docker_args = "--network host --device=/dev/kfd --device /dev/dri:/dev/dri:rw --volume /dev/dri:/dev/dri:rw --group-add video -e TUNA_LOGLEVEL=${tuna_loglevel} -e TUNA_CELERY_BROKER_HOST=${PIPELINE_CELERY_BROKER_HOST} -e TUNA_CELERY_BROKER_USER=${TUNA_CELERY_BROKER_USER} -e TUNA_CELERY_BROKER_PWD=${TUNA_CELERY_BROKER_PWD} -e TUNA_CELERY_BROKER_PORT=${TUNA_CELERY_BROKER_PORT} -e TUNA_CELERY_BACKEND_HOST=${PIPELINE_CELERY_BACKEND_HOST} -e TUNA_CELERY_BACKEND_PORT=${TUNA_CELERY_BACKEND_PORT} -e TUNA_DB_HOSTNAME=${db_host} -e TUNA_DB_NAME=${params.db_name} -e TUNA_DB_USER_NAME=${db_user} -e TUNA_DB_PASSWORD=${db_password} -e gateway_ip=${gateway_ip} -e gateway_port=${gateway_port} -e gateway_user=${gateway_user}"
}
parameters {
string(name: 'branch_name', defaultValue: 'init_session', description: '')
Expand All @@ -85,10 +84,11 @@ pipeline {
string(name: 'db_host', defaultValue: "${headnode}", description: 'Name of the machine hosting the database instance')
string(name: 'rocm_version', defaultValue: '', description: 'Version of ROCm for base docker packages, exclusive with osdb_bkc_version')
string(name: 'osdb_bkc_version', defaultValue: '', description: 'Build number for OSDB, exclusive with rocm_version')
string(name: 'build_miopen_deps', defaultValue: '', description: 'Build miopen dependencies: set to 1 to build dependencies, else leave blank')
string(name: 'db_name', defaultValue: "${PIPELINE_DB_NAME}", description: 'Name of the database schema')
string(name: 'db_user', defaultValue: "${PIPELINE_USER}", description: 'Username for the databse')
string(name: 'db_password', defaultValue: "${PIPELINE_PWD}", description: 'Password for the user')
string(name: 'docker_registry', defaultValue: "${headnode}:5000", description: 'Name of the docker registry for pushing images')
string(name: 'docker_registry', defaultValue: "${DOCKER_REGISTRY}", description: 'Name of the docker registry for pushing images')
string(name: 'base_image', defaultValue: '', description: 'Put a fully qualified docker name here to use (optional)')
}
stages {
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/load_jobs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pipeline {
string(name: 'db_name', defaultValue: "${PIPELINE_DB_NAME}", description: 'Name of the database schema')
string(name: 'db_user', defaultValue: "${PIPELINE_USER}", description: 'Username for the databse')
string(name: 'db_password', defaultValue: "${PIPELINE_PWD}", description: 'Password for the user')
string(name: 'docker_registry', defaultValue: "${headnode}:5000", description: 'Name of the docker registry for pushing images')
string(name: 'docker_registry', defaultValue: "${DOCKER_REGISTRY}", description: 'Name of the docker registry for pushing images')
string(name: 'base_image', defaultValue: '', description: 'Put a fully qualified docker name here to use (optional)')
choice(name: 'cmd', choices: ['', 'conv', 'convfp16', 'convbfp16'], description: 'get configs for cmd type')
choice(name: 'stage', choices: ['perf', 'fin_find'], description: 'Load jobs args')
Expand Down
8 changes: 4 additions & 4 deletions .jenkins/perf_compile
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ pipeline {
agent { node { label 'slurm' } }
environment {
backend = 'HIPNOGPU'
docker_args = "--network host -e TUNA_LOGLEVEL=${tuna_loglevel} -e TUNA_DB_HOSTNAME=${db_host} -e TUNA_DB_NAME=${params.db_name} -e TUNA_DB_USER_NAME=${db_user} -e TUNA_DB_PASSWORD=${db_password}"
docker_args = "--network host -e TUNA_LOGLEVEL=${tuna_loglevel} -e TUNA_CELERY_BROKER_HOST=${PIPELINE_CELERY_BROKER_HOST} -e TUNA_CELERY_BROKER_USER=${TUNA_CELERY_BROKER_USER} -e TUNA_CELERY_BROKER_PWD=${TUNA_CELERY_BROKER_PWD} -e TUNA_CELERY_BROKER_PORT=${TUNA_CELERY_BROKER_PORT} -e TUNA_CELERY_BACKEND_HOST=${PIPELINE_CELERY_BACKEND_HOST} -e TUNA_CELERY_BACKEND_PORT=${TUNA_CELERY_BACKEND_PORT} -e TUNA_DB_HOSTNAME=${db_host} -e TUNA_DB_NAME=${params.db_name} -e TUNA_DB_USER_NAME=${db_user} -e TUNA_DB_PASSWORD=${db_password}"
db_name = "${params.db_name}"
partition = "${params.slurm_partition}"
branch_id = "${params.branch_name}_${BUILD_ID}"
CREDS = credentials("$DOCKER_CRED")
}
parameters {
string(name: 'branch_name', defaultValue: 'compile_pipe_gold', description: '')
string(name: 'branch_name', defaultValue: 'compile_pipe_celery', description: '')
choice(name: 'use_mlir', choices: ['On', 'Off'], description: 'Build MIOpen with MLIR enabled')
booleanParam(name: 'dynamic_solvers_only', defaultValue: false, description: 'Only use dynamic solvers in tuning')
string(name: 'session_id', defaultValue: '', description: 'session id for compile')
Expand All @@ -38,8 +39,7 @@ pipeline {
string(name: 'db_name', defaultValue: "${PIPELINE_DB_NAME}", description: 'Name of the database schema')
string(name: 'db_user', defaultValue: "${PIPELINE_USER}", description: 'Username for the databse')
string(name: 'db_password', defaultValue: "${PIPELINE_PWD}", description: 'Password for the user')
string(name: 'docker_registry', defaultValue: "${headnode}:5000", description: 'Name of the docker registry for pushing images')
string(name: 'base_image', defaultValue: '', description: 'Put a fully qualified docker name here to use (optional)')
string(name: 'docker_registry', defaultValue: "${DOCKER_REGISTRY}", description: 'Name of the docker registry for pushing images')
choice(name: 'stage', choices: ['perf', 'fin_find'], description: 'Compile method')
}
stages {
Expand Down
11 changes: 6 additions & 5 deletions .jenkins/perf_eval
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,24 @@ pipeline {
agent { node { label 'slurm' } }
environment {
backend = 'HIP'
docker_args = "--network host -e TUNA_LOGLEVEL=${tuna_loglevel} -e TUNA_DB_HOSTNAME=${db_host} -e TUNA_DB_NAME=${params.db_name} -e TUNA_DB_USER_NAME=${db_user} -e TUNA_DB_PASSWORD=${db_password} -e gateway_ip=${gateway_ip} -e gateway_port=${gateway_port} -e gateway_user=${gateway_user} --privileged --device=/dev/kfd --device /dev/dri:/dev/dri:rw --volume /dev/dri:/dev/dri:rw --group-add video"
docker_args = "--network host -e TUNA_LOGLEVEL=${tuna_loglevel} -e TUNA_CELERY_BROKER_HOST=${PIPELINE_CELERY_BROKER_HOST} -e TUNA_CELERY_BROKER_USER=${TUNA_CELERY_BROKER_USER} -e TUNA_CELERY_BROKER_PWD=${TUNA_CELERY_BROKER_PWD} -e TUNA_CELERY_BROKER_PORT=${TUNA_CELERY_BROKER_PORT} -e TUNA_CELERY_BACKEND_HOST=${PIPELINE_CELERY_BACKEND_HOST} -e TUNA_CELERY_BACKEND_PORT=${TUNA_CELERY_BACKEND_PORT} -e TUNA_DB_HOSTNAME=${db_host} -e TUNA_DB_NAME=${params.db_name} -e TUNA_DB_USER_NAME=${db_user} -e TUNA_DB_PASSWORD=${db_password} -e gateway_ip=${gateway_ip} -e gateway_port=${gateway_port} -e gateway_user=${gateway_user} --privileged --device=/dev/kfd --device /dev/dri:/dev/dri:rw --volume /dev/dri:/dev/dri:rw --group-add video"
db_name = "${params.db_name}"
partition = ""
branch_id = "${params.branch_name}_${BUILD_ID}"
CREDS = credentials("$DOCKER_CRED")
}
parameters {
string(name: 'branch_name', defaultValue: 'eval_pipe_gold', description: '')
string(name: 'branch_name', defaultValue: 'eval_pipe_celery', description: '')
choice(name: 'use_mlir', choices: ['On', 'Off'], description: 'Build MIOpen with MLIR enabled')
booleanParam(name: 'dynamic_solvers_only', defaultValue: false, description: 'Only use dynamic solvers in tuning')
string(name: 'session_id', defaultValue: '', description: 'session id for evaluation')
choice(name: 'tuna_loglevel', choices: ['WARN', 'ERROR', 'INFO'], description: 'Log level for TUNA')
string(name: 'env', defaultValue: '', description: 'Additional environment variables for compilation.')
string(name: 'env', defaultValue: 'HIP_FORCE_DEV_KERNARG=1', description: 'Additional environment variables for compilation.')
string(name: 'db_host', defaultValue: "${headnode}", description: 'Name of the machine hosting the database instance')
string(name: 'db_name', defaultValue: "${PIPELINE_DB_NAME}", description: 'Name of the database schema')
string(name: 'db_user', defaultValue: "${PIPELINE_USER}", description: 'Username for the databse')
string(name: 'db_password', defaultValue: "${PIPELINE_PWD}", description: 'Password for the user')
string(name: 'docker_registry', defaultValue: "${headnode}:5000", description: 'Name of the docker registry for pushing images')
string(name: 'base_image', defaultValue: '', description: 'Put a fully qualified docker name here to use (optional)')
string(name: 'docker_registry', defaultValue: "${DOCKER_REGISTRY}", description: 'Name of the docker registry for pushing images')
choice(name: 'stage', choices: ['perf', 'fin_find'], description: 'Evaluate method')
}
stages {
Expand Down
4 changes: 2 additions & 2 deletions .jenkins/query_config
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def QueryConfigs(arch, num_cu, fdb_prefix)
}
if(params.miopen_version != '')
{
sh "wget https://github.com/ROCmSoftwarePlatform/MIOpen/blob/${params.miopen_version}/src/kernels/${fdb_prefix}.HIP.fdb.txt?raw=true -O ${fdb_prefix}.HIP.fdb.txt"
sh "wget https://github.com/ROCm/MIOpen/blob/${params.miopen_version}/src/kernels/${fdb_prefix}.HIP.fdb.txt?raw=true -O ${fdb_prefix}.HIP.fdb.txt"
script_args = script_args + " --fdb_filename ${fdb_prefix}.HIP.fdb.txt"
archiveArtifacts "${fdb_prefix}.HIP.fdb.txt"
}
Expand All @@ -45,7 +45,7 @@ def VerifyArgs()
if(params.miopen_version != '')
{
// Checking only one arch is sufficient
statusCode = sh script:" wget -q --method=HEAD https://github.com/ROCmSoftwarePlatform/MIOpen/blob/${params.miopen_version}/src/kernels/gfx900_56.HIP.fdb.txt?raw=true ", returnStatus:true
statusCode = sh script:" wget -q --method=HEAD https://github.com/ROCm/MIOpen/blob/${params.miopen_version}/src/kernels/gfx900_56.HIP.fdb.txt?raw=true ", returnStatus:true
if(statusCode)
{
error "Invalid MIOpen version for find db"
Expand Down
7 changes: 4 additions & 3 deletions .jenkins/update_solvers
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ pipeline {
db_user = "${params.db_user}"
db_password = "${params.db_password}"
branch_name = "${params.branch_name}"
backend = 'HIPNOGPU'
backend = 'HIP'
docker_args = "--network host --device=/dev/kfd --device /dev/dri:/dev/dri:rw --volume /dev/dri:/dev/dri:rw --group-add video -e TUNA_LOGLEVEL=${tuna_loglevel} -e TUNA_CELERY_BROKER_HOST=${PIPELINE_CELERY_BROKER_HOST} -e TUNA_CELERY_BROKER_USER=${TUNA_CELERY_BROKER_USER} -e TUNA_CELERY_BROKER_PWD=${TUNA_CELERY_BROKER_PWD} -e TUNA_CELERY_BROKER_PORT=${TUNA_CELERY_BROKER_PORT} -e TUNA_CELERY_BACKEND_HOST=${PIPELINE_CELERY_BACKEND_HOST} -e TUNA_CELERY_BACKEND_PORT=${TUNA_CELERY_BACKEND_PORT} -e TUNA_DB_HOSTNAME=${db_host} -e TUNA_DB_NAME=${params.db_name} -e TUNA_DB_USER_NAME=${db_user} -e TUNA_DB_PASSWORD=${db_password} -e gateway_ip=${gateway_ip} -e gateway_port=${gateway_port} -e gateway_user=${gateway_user}"
branch_id = "${params.branch_name}_${BUILD_ID}"
CREDS = credentials("$DOCKER_CRED")
}
parameters {
string(name: 'branch_name', defaultValue: 'applic_pipe_gold', description: '')
Expand All @@ -38,8 +40,7 @@ pipeline {
string(name: 'db_name', defaultValue: "${PIPELINE_DB_NAME}", description: 'Name of the database schema')
string(name: 'db_user', defaultValue: "${PIPELINE_USER}", description: 'Username for the databse')
string(name: 'db_password', defaultValue: "${PIPELINE_PWD}", description: 'Password for the user')
string(name: 'docker_registry', defaultValue: "${headnode}:5000", description: 'Name of the docker registry for pushing images')
string(name: 'base_image', defaultValue: '', description: 'Put a fully qualified docker name here to use (optional)')
string(name: 'docker_registry', defaultValue: "${DOCKER_REGISTRY}", description: 'Name of the docker registry for pushing images')
}
stages {
stage("Check params")
Expand Down
32 changes: 32 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.9"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/sphinx/requirements.txt
Loading