repo_id stringlengths 21 96 | file_path stringlengths 31 155 | content stringlengths 1 92.9M | __index_level_0__ int64 0 0 |
|---|---|---|---|
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-configure-conda-channels | #!/bin/bash
# A utility script that configures conda channels
# Remove nightly channels if build is a release build
if rapids-is-release-build; then
conda config --system --remove channels rapidsai-nightly
conda config --system --remove channels dask/label/dev
fi
| 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/gpuci_conda_retry | #!/bin/bash
#
# gpuci_conda_retry
#
# Compatibility wrapper that calls to the new rapids-conda-retry script
# Configurable env vars GPUCI_* are re-exported as RAPIDS_*
rapids-echo-stderr "'gpuci_conda_retry' is deprecated, please use 'rapids-conda-retry' instead"
# alias old GPUCI_ env vars to new RAPIDS_ equivalent... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-get-artifact | #!/bin/bash
# Downloads an artifact, extracts it to a directory, and
# echoes the resulting directory's path
# Positional Arguments:
# 1) path to an artifact (e.g. ci/cudf/pull-request/12602/aa4da21/cudf_conda_python_cuda11_38_x86_64.tar.gz)
# Example Usage:
# rapids-get-artifact ci/cudf/pull-request/12602/aa4da21/... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-check-pr-job-dependencies | #!/bin/bash
# Checks whether a particular GitHub workflow job depends on all of the
# other jobs in the workflow.
#
# This is necessary since the RAPIDS branch protections are configured to require
# the "pr-builder" job to pass for all PRs. It's implied that that job depends
# on all other jobs in the workflow.
set -e... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-conda-retry | #!/bin/bash
#
# rapids-conda-retry
#
# wrapper for conda that retries the command after a CondaHTTPError,
# ChecksumMismatchError, or JSONDecodeError (ideally, any conda error that
# is normally resolved by retrying)
#
# This must be set in order for the script to recognize failing exit codes when
# output is piped to ... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-configure-sccache | #!/bin/bash
# A utility script that configures sccache environment variables
export CMAKE_CUDA_COMPILER_LAUNCHER=sccache
export CMAKE_CXX_COMPILER_LAUNCHER=sccache
export CMAKE_C_COMPILER_LAUNCHER=sccache
export SCCACHE_BUCKET=rapids-sccache-east
export SCCACHE_REGION=us-east-2
export SCCACHE_IDLE_TIMEOUT=... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-download-from-s3 | #!/bin/bash
# A utility script that downloads an artifact archive from S3, untars it,
# and prints the location where it was untarred.
# Positional Arguments:
# 1) package name to generate s3 path for
# 2) location to untar it to
set -euo pipefail
export RAPIDS_SCRIPT_NAME="rapids-download-from-s3"
if [ -z "$1" ] ... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-upload-artifacts-dir | #!/bin/bash
# A utility that uploads individual files from $RAPIDS_ARTIFACTS_DIR to S3
set -euo pipefail
source rapids-constants
pkg_prefix="$1"
if [ "${CI:-false}" = "false" ]; then
rapids-echo-stderr "Artifacts from local builds are not uploaded to S3."
exit 0
fi
if [ ! -d "${RAPIDS_ARTIFACTS_DIR}" ]; then
r... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-retry | #!/bin/bash
#
# rapids-retry
#
# retries a command 3 times after a non-zero exit, waiting 10 seconds
# between attempts. 3 times and 10 seconds are default values which can be
# configured with env vars described below.
#
# NOTE: source this file to update your bash environment with the settings
# below. Keep in mi... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-download-docker-from-s3 | #!/bin/bash
# A utility script that downloads a docker image from S3
# Positional Arguments:
# 1) image tag
set -eo pipefail
source rapids-constants
export RAPIDS_SCRIPT_NAME="rapids-download-docker-from-s3"
tmp_dir="$(mktemp -d)"
if [ -z "$1" ]; then
rapids-echo-stderr "Must specify input argument: IMAGE_TAG"
... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-docker-multiarch-from-s3 | #!/bin/bash
# A utility script that downloads all docker images from S3
# and assembles them into multiarch tags
# Optional Positional Arguments:
# 1) latest tag to match
# 2) latest tag alias to apply if tag matches latest tag
set -eo pipefail
set -x
source rapids-constants
export RAPIDS_SCRIPT_NAME="rapids-docke... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-upload-to-anaconda | #!/bin/bash
# A utility script that uploads all the conda packages from a
# GitHub Actions workflow run to Anaconda.org
set -euo pipefail
source rapids-constants
export RAPIDS_SCRIPT_NAME="rapids-upload-to-anaconda"
case "${RAPIDS_BUILD_TYPE}" in
branch)
;&
nightly)
;;
*)
rapids-echo-stderr "Only bra... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-size-checker | #!/bin/bash
set -eu
export RAPIDS_SCRIPT_NAME="rapids-size-checker"
echo "Retrieving base branch from GitHub API:"
# For PRs, the branch name is like:
# pull-request/989
pr_num="${GITHUB_REF_NAME##*/}"
curl_headers=('-H' "Authorization: token ${RAPIDS_GH_TOKEN}")
resp=$(
curl \
-H "Accept: application/vnd.github.... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-upload-conda-to-s3 | #!/bin/bash
# A utility script that tars up $RAPIDS_CONDA_BLD_OUTPUT_DIR and uploads it to S3
# Positional Arguments:
# 1) a string of "cpp" or "python" which determines which conda artifact
# should be uploaded
set -euo pipefail
pkg_type="$1"
case "${pkg_type}" in
cpp)
;&
python)
;;
*)
echo '... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-extract-conda-files | #!/bin/bash
# A utility script that extracts all conda packages
# after being downloaded by rapids-download-conda-from-s3
set -eo pipefail
export RAPIDS_SCRIPT_NAME="rapids-extract-conda-files"
if [ -z "$1" ]; then
rapids-echo-stderr "Must specify input argument: TARBALL_DIR"
exit 1
fi
# dir that the extracted ta... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-package-name | #!/bin/bash
# A utility script that generates a package name from a package type
# Positional Arguments:
# 1) package type
set -euo pipefail
export RAPIDS_SCRIPT_NAME="rapids-package-name"
repo_name="${RAPIDS_REPOSITORY##*/}"
if [ -z "$1" ]; then
rapids-echo-stderr "Must specify input arguments: PKG_TYPE"
exit ... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-wheel-ctk-name-gen | #!/bin/bash
# A utility script that generates CUDA suffix in the format "cu${VER}" where `$VER`
# is the CUDA major version (for example, "cu11").
# Positional Arguments:
# 1) ctk tag
set -eu -o pipefail
if [ -z "$1" ]; then
rapids-echo-stderr "Must specify input argument: CTK_TAG"
exit 1
fi
ctk_tag="$1"
ctk_ma... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-upload-docs | #!/bin/bash
# This script uploads RAPIDS docs to S3.
# The docs are expected to be in the following directory structure:
# $RAPIDS_DOCS_DIR
# βββ cudf
# β βββ html
# β β βββ <html files>
# β βββ txt
# β βββ <txt files>
# βββ dask-cudf
# βββ html
# β βββ <html files>
# βββ txt
# βββ <... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-dependency-file-checker | #!/bin/bash
# A utility script that ensures all generated dependency files are up-to-date
# Positional Arguments:
# 1) config file path
set -eo pipefail
CONFIG_FILE=$1
# delete existing generated files by grepping for files w/ "generated by" header
SEARCH_PATTERN='^# This file is generated by `rapids.*'
grep -rlP \... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-env-update | #!/bin/bash
# A utility script that examines environment variables provided
# by Jenkins to make some environment changes depending on whether
# a nightly or stable build is occurring.
set -euo pipefail
rapids-configure-conda-channels
source rapids-configure-sccache
source rapids-date-string
| 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-find-anaconda-uploads.py | #!/usr/bin/env python3
# shellcheck disable=all
import glob
import sys
from os import environ, path
"""
Script that finds all Anaconda packages that should be uploaded to Anaconda.org
within a given directory.
Positional Arguments:
1: relative or absolute path to search for packages
Examples:
"/tmp/cpp_chann... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-twine | #!/bin/bash
# A utility script that wraps twine to upload all pip wheels of a workflow run
#
# Positional Arguments:
# 1) wheel name
set -exou pipefail
source rapids-constants
export RAPIDS_SCRIPT_NAME="rapids-twine"
if [ -z "$1" ]; then
rapids-echo-stderr "Must specify input arguments: WHEEL_NAME"
exit 1
fi
WH... | 0 |
rapidsai_public_repos/gha-tools | rapidsai_public_repos/gha-tools/tools/rapids-get-pr-conda-artifact | #!/bin/bash
# Echo path to an artifact for a specific PR. Finds and uses the latest commit on the PR.
#
# Positional Arguments:
# 1) repo name
# 2) PR number
# 3) "cpp" or "python", to get the artifact for the C++ or Python build, respectively
# 4) [optional] commit hash, to get the artifact for a specific comm... | 0 |
rapidsai_public_repos | rapidsai_public_repos/ucx-py/.pre-commit-config.yaml | repos:
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--settings-path=pyproject.toml"]
exclude: __init__.py$
types: [text]
types_or: [python, cython, pyi]
- repo: https://github.com/a... | 0 |
rapidsai_public_repos | rapidsai_public_repos/ucx-py/pyproject.toml | # Copyright (c) 2021-2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 0 |
rapidsai_public_repos | rapidsai_public_repos/ucx-py/.flake8 | [flake8]
ignore = E901,E225,E226,E227,E999,E203,W503
exclude =
.eggs,
*.egg,
build,
__init__.py,
max-line-length = 88
# Ignore black/flake8-pyi conflicts
per-file-ignores =
*.pyi:E301 E302 E704
| 0 |
rapidsai_public_repos | rapidsai_public_repos/ucx-py/.flake8.cython | #
# Copyright (c) 2018-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 0 |
rapidsai_public_repos | rapidsai_public_repos/ucx-py/README.md | []( https://ucx-py.readthedocs.io/en/latest/ )
# Python Bindings for UCX
## Installing
Users can either [install with Conda]( https://ucx-py.readthedocs.io/en/latest/install.html#conda ) or [build from source]( h... | 0 |
rapidsai_public_repos | rapidsai_public_repos/ucx-py/.readthedocs.yml | version: 2
build:
os: "ubuntu-22.04"
tools:
python: "mambaforge-22.9"
python:
install:
- method: pip
path: .
conda:
environment: conda/environments/builddocs.yml
sphinx:
configuration: docs/source/conf.py
| 0 |
rapidsai_public_repos | rapidsai_public_repos/ucx-py/MANIFEST.in | # Python type stubs
recursive-include ucp *.pyi
| 0 |
rapidsai_public_repos | rapidsai_public_repos/ucx-py/dependencies.yaml | # Dependency list for https://github.com/rapidsai/dependency-file-generator
files:
all:
output: none
includes:
- checks
- cudatoolkit
- py_version
- run
- test_python
test_python:
output: none
includes:
- cudatoolkit
- py_version
- test_python
checks... | 0 |
rapidsai_public_repos | rapidsai_public_repos/ucx-py/setup.py | # Copyright (c) 2018-2021, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
# This file is a copy of what is available in a Cython demo + some additions
from __future__ import absolute_import, print_function
import os
from distutils.sysconfig import get_config_var, get_python_inc
from Cython.D... | 0 |
rapidsai_public_repos | rapidsai_public_repos/ucx-py/LICENSE | Copyright (c) 2019-2021 NVIDIA CORPORATION. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and ... | 0 |
rapidsai_public_repos | rapidsai_public_repos/ucx-py/VERSION | 0.36.0
| 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_benchmark_cluster.py | import asyncio
import tempfile
from itertools import chain
import numpy as np
import pytest
from ucp.benchmarks.utils import _run_cluster_server, _run_cluster_workers
async def _worker(rank, eps, args):
futures = []
# Send my rank to all others
for ep in eps.values():
futures.append(ep.send(np.a... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_custom_send_recv.py | import asyncio
import pickle
import numpy as np
import pytest
import ucp
cudf = pytest.importorskip("cudf")
distributed = pytest.importorskip("distributed")
cuda = pytest.importorskip("numba.cuda")
@pytest.mark.asyncio
@pytest.mark.parametrize(
"g",
[
lambda cudf: cudf.Series([1, 2, 3]),
la... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_send_recv_two_workers.py | import asyncio
import multiprocessing
import os
import random
import numpy as np
import pytest
from utils import am_recv, am_send, get_cuda_devices, get_num_gpus, recv, send
import ucp
from ucp.utils import get_event_loop
cupy = pytest.importorskip("cupy")
rmm = pytest.importorskip("rmm")
distributed = pytest.import... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_probe.py | import asyncio
import pytest
import ucp
@pytest.mark.asyncio
@pytest.mark.parametrize("transfer_api", ["am", "tag"])
async def test_message_probe(transfer_api):
msg = bytearray(b"0" * 10)
async def server_node(ep):
# Wait for remote endpoint to close before probing the endpoint for
# in-tra... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_rma.py | import pytest
import ucp
@pytest.mark.asyncio
@pytest.mark.parametrize("blocking_progress_mode", [True, False])
async def test_fence(blocking_progress_mode):
# Test needs to be async here to ensure progress tasks are cleared
# and avoid warnings.
ucp.init(blocking_progress_mode=blocking_progress_mode)
... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_config.py | import os
from unittest.mock import patch
import pytest
from utils import captured_logger
import ucp
def test_get_config():
with patch.dict(os.environ):
# Unset to test default value
if os.environ.get("UCX_TLS") is not None:
del os.environ["UCX_TLS"]
ucp.reset()
confi... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_multiple_nodes.py | import asyncio
import numpy as np
import pytest
import ucp
def get_somaxconn():
with open("/proc/sys/net/core/somaxconn", "r") as f:
return int(f.readline())
async def hello(ep):
msg2send = np.arange(10)
msg2recv = np.empty_like(msg2send)
f1 = ep.send(msg2send)
f2 = ep.recv(msg2recv)
... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_from_worker_address.py | import asyncio
import multiprocessing as mp
import os
import struct
import numpy as np
import pytest
import ucp
from ucp.utils import get_event_loop
mp = mp.get_context("spawn")
def _test_from_worker_address_server(queue):
async def run():
# Send worker address to client process via multiprocessing.Que... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_ucx_getters.py | import pytest
import ucp
@pytest.mark.asyncio
async def test_get_ucp_worker():
worker = ucp.get_ucp_worker()
assert isinstance(worker, int)
async def server(ep):
assert ep.get_ucp_worker() == worker
lt = ucp.create_listener(server)
ep = await ucp.create_endpoint(ucp.get_address(), lt.po... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_info.py | import pytest
import ucp
@pytest.fixture(autouse=True)
def reset():
ucp.reset()
yield
ucp.reset()
def test_context_info():
info = ucp.get_ucp_context_info()
assert isinstance(info, str)
def test_worker_info():
info = ucp.get_ucp_worker_info()
assert isinstance(info, str)
@pytest.mar... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_disconnect.py | import asyncio
import logging
import multiprocessing as mp
from io import StringIO
from queue import Empty
import numpy as np
import pytest
import ucp
from ucp.utils import get_event_loop
mp = mp.get_context("spawn")
async def mp_queue_get_nowait(queue):
while True:
try:
return queue.get_no... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_endpoint.py | import asyncio
import pytest
import ucp
@pytest.mark.asyncio
@pytest.mark.parametrize("server_close_callback", [True, False])
async def test_close_callback(server_close_callback):
closed = [False]
def _close_callback():
closed[0] = True
async def server_node(ep):
if server_close_callba... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_from_worker_address_error.py | import asyncio
import multiprocessing as mp
import os
import re
import time
from unittest.mock import patch
import numpy as np
import pytest
import ucp
from ucp.utils import get_event_loop
mp = mp.get_context("spawn")
def _test_from_worker_address_error_server(q1, q2, error_type):
async def run():
addr... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/conftest.py | import asyncio
import os
import pytest
import ucp
# Prevent calls such as `cudf = pytest.importorskip("cudf")` from initializing
# a CUDA context. Such calls may cause tests that must initialize the CUDA
# context on the appropriate device to fail.
# For example, without `RAPIDS_NO_INITIALIZE=True`, `test_benchmark_... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_tags.py | import asyncio
import pytest
import ucp
@pytest.mark.asyncio
async def test_tag_match():
msg1 = bytes("msg1", "utf-8")
msg2 = bytes("msg2", "utf-8")
async def server_node(ep):
f1 = ep.send(msg1, tag="msg1")
await asyncio.sleep(1) # Let msg1 finish
f2 = ep.send(msg2, tag="msg2")... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_send_recv.py | import functools
import pytest
import ucp
np = pytest.importorskip("numpy")
msg_sizes = [2**i for i in range(0, 25, 4)]
dtypes = ["|u1", "<i8", "f8"]
def make_echo_server(create_empty_data):
"""
Returns an echo server that calls the function `create_empty_data(nbytes)`
to create the data container.`
... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_shutdown.py | import asyncio
import numpy as np
import pytest
import ucp
async def _shutdown_send(ep, message_type):
msg = np.arange(10**6)
if message_type == "tag":
await ep.send(msg)
else:
await ep.am_send(msg)
async def _shutdown_recv(ep, message_type):
if message_type == "tag":
msg =... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_reset.py | import pytest
import ucp
class ResetAfterN:
"""Calls ucp.reset() after n calls"""
def __init__(self, n):
self.n = n
self.count = 0
def __call__(self):
self.count += 1
if self.count == self.n:
ucp.reset()
@pytest.mark.asyncio
async def test_reset():
rese... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_version.py | import ucp
def test_get_ucx_version():
version = ucp.get_ucx_version()
assert isinstance(version, tuple)
assert len(version) == 3
# Check UCX isn't initialized
assert ucp.core._ctx is None
def test_version_constant():
assert isinstance(ucp.__version__, str)
def test_ucx_version_constant():... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/utils.py | import io
import logging
import os
from contextlib import contextmanager
import numpy as np
import pytest
import ucp
normal_env = {
"UCX_RNDV_SCHEME": "put_zcopy",
"UCX_MEMTYPE_CACHE": "n",
"UCX_TLS": "rc,cuda_copy,cuda_ipc",
"CUDA_VISIBLE_DEVICES": "0",
}
def set_env():
os.environ.update(norma... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/tests/test_send_recv_am.py | import asyncio
from functools import partial
import numpy as np
import pytest
import ucp
msg_sizes = [0] + [2**i for i in range(0, 25, 4)]
def _bytearray_assert_equal(a, b):
assert a == b
def get_data():
ret = [
{
"allocator": bytearray,
"generator": lambda n: bytearray(b"... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/ucp/core.py | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2020 UT-Battelle, LLC. All rights reserved.
# See file LICENSE for terms.
import array
import asyncio
import gc
import logging
import os
import re
import struct
import weakref
from functools import partial
from os import close as... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/ucp/exceptions.py | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
from ._libs.exceptions import * # noqa
| 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/ucp/_version.py | # Copyright (c) 2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/ucp/comm.py | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2020 UT-Battelle, LLC. All rights reserved.
# See file LICENSE for terms.
import asyncio
from typing import Union
from ._libs import arr, ucx_api
from .utils import get_event_loop
def _cb_func(request, exception, event_loop, f... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/ucp/endpoint_reuse.py | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
import ctypes
import pickle
import uuid
from . import core
class EPHandle:
def __init__(self, ep):
self.ep = ep
self.refcount = 1
class EndpointReuse:
"""Class to seamlessly reuse endpoints.
... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/ucp/__init__.py | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
"""UCX-Py: Python bindings for UCX <www.openucx.org>"""
import logging
import os
logger = logging.getLogger("ucx")
# Notice, if we have to update environment variables we need to do it
# before importing UCX, which mus... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/ucp/continuous_ucx_progress.py | # Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
import asyncio
import socket
import weakref
class ProgressTask(object):
def __init__(self, worker, event_loop):
"""Creates a task that keeps calling worker.progress()
Notice, class and created task ... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/ucp/utils.py | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
import asyncio
import hashlib
import logging
import multiprocessing as mp
import os
import socket
import time
import numpy as np
mp = mp.get_context("spawn")
def get_event_loop():
"""
Get running or create new... | 0 |
rapidsai_public_repos/ucx-py | rapidsai_public_repos/ucx-py/ucp/VERSION | 0.36.0
| 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/benchmarks/cudf_merge.py | """
Benchmark send receive on one machine
"""
import argparse
import asyncio
import cProfile
import gc
import io
import os
import pickle
import pstats
import sys
import tempfile
from time import monotonic as clock
import cupy
import numpy as np
import ucp
from ucp._libs.utils import (
format_bytes,
format_tim... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/benchmarks/README.md | # Running Benchmarks
## cuDF Merge
The cuDF merge benchmark can be executed in 3 different ways:
1. Local-node only;
1. Multi-node with automatic process launch via SSH;
1. Multi-node with manual process launch.
In the following subsections we will exemplify how to launch the benchmark for each case. Be sure to che... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/benchmarks/asyncssh.py | import asyncio
import json
import logging
import os
import queue
import sys
from functools import partial
logger = logging.getLogger("ucx.asyncssh")
logger.setLevel(logging.getLevelName(os.getenv("UCXPY_ASYNCSSH_LOG_LEVEL", "WARNING")))
try:
import asyncssh
class SSHProc(asyncssh.SSHClientSession):
d... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/benchmarks/__init__.py | # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
| 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/benchmarks/utils.py | import asyncio
import json
import logging
import multiprocessing as mp
import os
import pickle
import threading
from types import ModuleType
import numpy as np
from ucp._libs.utils import get_address
logger = logging.getLogger("ucx")
def _ensure_cuda_device(devs, rank):
import numba.cuda
dev_id = devs[ran... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/benchmarks/send_recv.py | """
Benchmark send receive on one machine:
UCX_TLS=tcp,cuda_copy,cuda_ipc python send-recv.py \
--server-dev 2 --client-dev 1 --object_type rmm \
--reuse-alloc --n-bytes 1GB
Benchmark send receive on two machines (IB testing):
# server process
UCX_MAX_RNDV_RAILS=1 UCX_TLS=tcp,cuda_copy,rc python send-... | 0 |
rapidsai_public_repos/ucx-py/ucp/benchmarks | rapidsai_public_repos/ucx-py/ucp/benchmarks/backends/ucp_async.py | import asyncio
from argparse import Namespace
from queue import Queue
from time import monotonic
import ucp
from ucp._libs.arr import Array
from ucp._libs.utils import print_key_value
from ucp.benchmarks.backends.base import BaseClient, BaseServer
from ucp.benchmarks.utils import get_allocator
def register_am_alloca... | 0 |
rapidsai_public_repos/ucx-py/ucp/benchmarks | rapidsai_public_repos/ucx-py/ucp/benchmarks/backends/tornado.py | import asyncio
from time import monotonic
import numpy as np
from tornado.iostream import StreamClosedError
from tornado.tcpclient import TCPClient
from tornado.tcpserver import TCPServer
from ucp.benchmarks.backends.base import BaseClient, BaseServer
class TornadoServer(BaseServer):
has_cuda_support = False
... | 0 |
rapidsai_public_repos/ucx-py/ucp/benchmarks | rapidsai_public_repos/ucx-py/ucp/benchmarks/backends/__init__.py | # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
| 0 |
rapidsai_public_repos/ucx-py/ucp/benchmarks | rapidsai_public_repos/ucx-py/ucp/benchmarks/backends/base.py | from abc import ABC, abstractmethod
from argparse import Namespace
from queue import Queue
class BaseServer(ABC):
@abstractmethod
def __init__(self, args: Namespace, queue: Queue):
"""
Benchmark server.
Parameters
----------
args: argparse.Namespace
Parsed ... | 0 |
rapidsai_public_repos/ucx-py/ucp/benchmarks | rapidsai_public_repos/ucx-py/ucp/benchmarks/backends/ucp_core.py | from argparse import Namespace
from queue import Queue
from threading import Lock
from time import monotonic
import ucp
from ucp._libs import ucx_api
from ucp._libs.arr import Array
from ucp._libs.utils import print_key_value
from ucp._libs.utils_test import (
blocking_am_recv,
blocking_am_send,
blocking_r... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/ucx_api.pyi | import enum
from typing import Callable, Dict, Iterable, Mapping, Optional, Tuple
# typedefs.pyx
class AllocatorType(enum.Enum):
HOST: int
CUDA: int
UNSUPPORTED: int
class Feature(enum.Enum):
TAG: int
RMA: int
AMO32: int
AMO64: int
WAKEUP: int
STREAM: int
AM: int
# utils.pyx
... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/ucx_worker.pyx | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2020 UT-Battelle, LLC. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
import logging
import socket
from libc.stdint cimport uint16_t, uintptr_t
from libc.stdio cimport FILE
from libc.string cimpor... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/ucx_rma.pyx | from io import RawIOBase
from .arr cimport Array
from .exceptions import UCXError
from .ucx_api_dep cimport *
class RemoteMemory:
"""This class wraps all of the rkey meta data and remote memory locations to do
simple RMA operations.
"""
def __init__(self, rkey, base, length):
self._rkey = ... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/transfer_common.pyx | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2020 UT-Battelle, LLC. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
from libc.stdint cimport uintptr_t
from .exceptions import UCXCanceled, UCXError, log_errors
from .ucx_api_dep cimport *
# T... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/utils_test.py | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
import multiprocessing as mp
from ucp._libs import ucx_api
from ucp._libs.arr import Array
mp = mp.get_context("spawn")
def blocking_handler(request, exception, finished):
assert exception is None
finished[0] ... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/ucx_object.pyx | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
import weakref
def _handle_finalizer_wrapper(
children, handle_finalizer, handle_as_int, *extra_args, **extra_kargs
):
for weakref_to_child in children:
child = weakref_to_chi... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/ucx_listener.pyx | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
from libc.stdint cimport uint16_t, uintptr_t
from .exceptions import log_errors
from .ucx_api_dep cimport *
cdef void _listener_callback(ucp_conn_request_h conn_request, void *args) with gil... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/exceptions.py | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
import contextlib
import logging
logger = logging.getLogger("ucx")
@contextlib.contextmanager
def log_errors(reraise_exception=False):
try:
yield
except BaseException as e:
logger.exception(e)
... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/arr.pxd | # Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
from libc.stdint cimport uintptr_t
cdef class Array:
cdef readonly uintptr_t ptr
cdef readonly bint readonly
cdef readonly object obj
cdef readonly Py_ssize_t itemsize
... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/ucx_memory_handle.pyx | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2021, UT-Battelle, LLC. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
from libc.stdint cimport uintptr_t
from .arr cimport Array
from .ucx_api_dep cimport *
def _ucx_mem_handle_finalizer(uintptr... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/utils.pyx | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2021 UT-Battelle, LLC. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
from cpython.buffer cimport PyBUF_FORMAT, PyBUF_ND, PyBUF_WRITABLE
from libc.stdio cimport (
FILE,
SEEK_END,
SEEK_S... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/arr.pyi | from typing import Tuple
class Array:
def __init__(self, obj: object): ...
@property
def c_contiguous(self) -> bool: ...
@property
def f_contiguous(self) -> bool: ...
@property
def contiguous(self) -> bool: ...
@property
def nbytes(self) -> int: ...
@property
def shape(self)... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/ucx_context.pyx | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2021 UT-Battelle, LLC. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
import functools
import logging
from libc.stdint cimport uintptr_t
from libc.stdio cimport FILE
from libc.string cimport memse... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/ucxio.pyx | # Copyright (c) 2021, UT-Battelle, LLC. All rights reserved.
# See file LICENSE for terms.
from io import SEEK_CUR, SEEK_END, SEEK_SET, RawIOBase
from .arr cimport Array
from .ucx_api_dep cimport *
def blocking_handler(request, exception, finished):
assert exception is None
finished[0] = True
class UCXIO(... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/ucx_endpoint.pyx | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2020-2021, UT-Battelle, LLC. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
import logging
import warnings
from libc.stdint cimport uintptr_t
from libc.stdio cimport FILE
from .exceptions import UCXCan... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/transfer_tag.pyx | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2020 UT-Battelle, LLC. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
from libc.stdint cimport uintptr_t
from .arr cimport Array
from .exceptions import UCXCanceled, UCXError, UCXMsgTruncated, log... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/__init__.pxd | # Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
| 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/packed_remote_key.pyx | # Copyright (c) 2021 UT-Battelle, LLC. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
from libc.stdint cimport uintptr_t
from libc.stdlib cimport free
from libc.string cimport memcpy
from .arr cimport Array
from .ucx_api_dep cimport *
cdef class PackedRemoteKey:
""" A packe... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/ucx_rkey.pyx | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2021, UT-Battelle, LLC. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
import logging
from libc.stdint cimport uintptr_t
from .arr cimport Array
from .ucx_api_dep cimport *
logger = logging.getLogger("ucx"... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/arr.pyx | # Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
from cpython.array cimport array, newarrayobject
from cpython.buffer cimport PyBuffer_IsContiguous
from cpython.memoryview cimport (
PyMemoryView_FromObject,
PyMemoryView_GET_BUFFER,
)... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/ucx_api_dep.pxd | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2020 UT-Battelle, LLC. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
from posix.stdio cimport open_memstream
from posix.unistd cimport close
from cpython.ref cimport Py_DECREF, Py_INCREF, PyObject... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/typedefs.pyx | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
import enum
from cpython.ref cimport PyObject
from .ucx_api_dep cimport *
class Feature(enum.Enum):
"""Enum of the UCP_FEATURE_* constants"""
TAG = UCP_FEATURE_TAG
RMA = UCP_FEA... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/transfer_am.pyx | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2020 UT-Battelle, LLC. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
import functools
import logging
from libc.stdint cimport uintptr_t
from libc.stdlib cimport free
from .arr cimport Array
from... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/ucx_worker_cb.pyx | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# Copyright (c) 2020 UT-Battelle, LLC. All rights reserved.
# See file LICENSE for terms.
# cython: language_level=3
import logging
from cython cimport boundscheck, initializedcheck, nonecheck, wraparound
from libc.stdint cimport uintptr_t
fro... | 0 |
rapidsai_public_repos/ucx-py/ucp | rapidsai_public_repos/ucx-py/ucp/_libs/ucx_api.pyx | # Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
include "packed_remote_key.pyx"
include "transfer_am.pyx"
include "transfer_common.pyx"
include "transfer_stream.pyx"
include "transfer_tag.pyx"
include "typedefs.pyx"
include "ucx_address.pyx"
include "ucx_context.pyx"
i... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.