Skip to content

Commit

Permalink
Merge amd-master into release/rocm-rel-6.2 20240710
Browse files Browse the repository at this point in the history
Signed-off-by: Maisam Arif <[email protected]>
Change-Id: Ieb281513769476382881c4e8186f09091d950944
  • Loading branch information
marifamd committed Jul 11, 2024
2 parents a1fc39c + 3cd6774 commit 5ac86f6
Show file tree
Hide file tree
Showing 16 changed files with 562 additions and 188 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ python:
build:
os: ubuntu-22.04
tools:
python: "3.8"
python: "3.10"
apt_packages:
- "graphviz" # For dot graphs in doxygen
35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,41 @@ Full documentation for rocm_smi_lib is available at [https://rocm.docs.amd.com/]

***All information listed below is for reference and subject to change.***

## rocm_smi_lib for ROCm 6.2

### Added

- **Added Partition ID API (`rsmi_dev_partition_id_get(..)`)**
Previously `rsmi_dev_partition_id_get` could only be retrived by querying through `rsmi_dev_pci_id_get()`
and parsing optional bits in our python CLI/API. We are now making this available directly through API.
As well as added testing, in our compute partitioning tests verifing partition IDs update accordingly.

### Changed

- N/A

### Optimized

- N/A

### Fixed

- **Partition ID CLI output**
Due to driver changes in KFD, some devices may report bits [31:28] or [2:0]. With the newly added `rsmi_dev_partition_id_get(..)`, we provided this fallback to properly retreive partition ID. We
plan to eventually remove partition ID from the function portion of the BDF (Bus Device Function). See below for PCI ID description.

- bits [63:32] = domain
- bits [31:28] or bits [2:0] = partition id
- bits [27:16] = reserved
- bits [15:8] = Bus
- bits [7:3] = Device
- bits [2:0] = Function (partition id maybe in bits [2:0]) <-- Fallback for non SPX modes

### Known Issues

- N/A


## rocm_smi_lib for ROCm 6.1.2

### Added
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ find_program (GIT NAMES git)

## Setup the package version based on git tags.
set(PKG_VERSION_GIT_TAG_PREFIX "rsmi_pkg_ver")
get_package_version_number("7.2.0" ${PKG_VERSION_GIT_TAG_PREFIX} GIT)
get_package_version_number("7.3.0" ${PKG_VERSION_GIT_TAG_PREFIX} GIT)
message("Package version: ${PKG_VERSION_STR}")
set(${ROCM_SMI_LIBS_TARGET}_VERSION_MAJOR "${CPACK_PACKAGE_VERSION_MAJOR}")
set(${ROCM_SMI_LIBS_TARGET}_VERSION_MINOR "${CPACK_PACKAGE_VERSION_MINOR}")
Expand Down
2 changes: 1 addition & 1 deletion DEBIAN/postinst.in
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ do_ldconfig() {
case "$1" in
( configure )
do_ldconfig
do_configureLogrotate || return 0
do_configureLogrotate || exit 0
;;
( abort-upgrade | abort-remove | abort-deconfigure )
echo "$1"
Expand Down
2 changes: 1 addition & 1 deletion RPM/post.in
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,5 @@ do_ldconfig() {
# post install or upgrade, $i is 1 or 2 -> do these actions
if [ "$1" -ge 1 ]; then
do_ldconfig
do_configureLogrotate || return 0
do_configureLogrotate || exit 0
fi
2 changes: 1 addition & 1 deletion docs/sphinx/requirements.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rocm-docs-core[api_reference]>=0.31.0
rocm-docs-core[api_reference]==1.4.0
128 changes: 63 additions & 65 deletions docs/sphinx/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,130 +1,126 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile requirements.in
#
accessible-pygments==0.0.4
accessible-pygments==0.0.5
# via pydata-sphinx-theme
alabaster==0.7.13
alabaster==0.7.16
# via sphinx
babel==2.12.1
babel==2.15.0
# via
# pydata-sphinx-theme
# sphinx
beautifulsoup4==4.12.2
beautifulsoup4==4.12.3
# via pydata-sphinx-theme
breathe==4.34.0
breathe==4.35.0
# via rocm-docs-core
certifi==2022.12.7
certifi==2024.6.2
# via requests
cffi==1.15.1
cffi==1.16.0
# via
# cryptography
# pynacl
charset-normalizer==3.1.0
charset-normalizer==3.3.2
# via requests
click==8.1.3
click==8.1.7
# via
# click-log
# doxysphinx
# sphinx-external-toc
click-log==0.4.0
# via doxysphinx
cryptography==40.0.2
cryptography==42.0.8
# via pyjwt
deprecated==1.2.13
deprecated==1.2.14
# via pygithub
docutils==0.16
docutils==0.21.2
# via
# breathe
# myst-parser
# pydata-sphinx-theme
# sphinx
doxysphinx==3.3.7
doxysphinx==3.3.8
# via rocm-docs-core
fastjsonschema==2.18.0
fastjsonschema==2.19.1
# via rocm-docs-core
gitdb==4.0.10
gitdb==4.0.11
# via gitpython
gitpython==3.1.31
gitpython==3.1.43
# via rocm-docs-core
idna==3.4
idna==3.7
# via requests
imagesize==1.4.1
# via sphinx
importlib-metadata==6.4.1
# via sphinx
importlib-resources==5.10.4
# via rocm-docs-core
jinja2==3.1.2
jinja2==3.1.4
# via
# myst-parser
# sphinx
libsass==0.22.0
# via doxysphinx
lxml==4.9.2
lxml==4.9.4
# via doxysphinx
markdown-it-py==2.2.0
markdown-it-py==3.0.0
# via
# mdit-py-plugins
# myst-parser
markupsafe==2.1.2
markupsafe==2.1.5
# via jinja2
mdit-py-plugins==0.3.5
mdit-py-plugins==0.4.1
# via myst-parser
mdurl==0.1.2
# via markdown-it-py
mpire==2.8.0
mpire==2.10.2
# via doxysphinx
myst-parser==1.0.0
myst-parser==3.0.1
# via rocm-docs-core
packaging==23.1
numpy==1.26.4
# via doxysphinx
packaging==24.1
# via
# pydata-sphinx-theme
# sphinx
pycparser==2.21
pycparser==2.22
# via cffi
pydata-sphinx-theme==0.13.3
pydata-sphinx-theme==0.15.3
# via
# rocm-docs-core
# sphinx-book-theme
pygithub==1.58.1
pygithub==2.3.0
# via rocm-docs-core
pygments==2.15.0
pygments==2.18.0
# via
# accessible-pygments
# mpire
# pydata-sphinx-theme
# sphinx
pyjson5==1.6.4
pyjson5==1.6.6
# via doxysphinx
pyjwt[crypto]==2.6.0
pyjwt[crypto]==2.8.0
# via pygithub
pynacl==1.5.0
# via pygithub
pyparsing==3.0.9
pyparsing==3.1.2
# via doxysphinx
pytz==2023.3.post1
# via babel
pyyaml==6.0
pyyaml==6.0.1
# via
# myst-parser
# rocm-docs-core
# sphinx-external-toc
requests==2.28.2
requests==2.32.3
# via
# pygithub
# sphinx
rocm-docs-core[api_reference]>=0.31.0
rocm-docs-core[api-reference]==1.4.0
# via -r requirements.in
smmap==5.0.0
smmap==5.0.1
# via gitdb
snowballstemmer==2.2.0
# via sphinx
soupsieve==2.4.1
soupsieve==2.5
# via beautifulsoup4
sphinx==5.3.0
sphinx==7.3.7
# via
# breathe
# myst-parser
Expand All @@ -135,37 +131,39 @@ sphinx==5.3.0
# sphinx-design
# sphinx-external-toc
# sphinx-notfound-page
sphinx-book-theme==1.0.1
sphinx-book-theme==1.1.3
# via rocm-docs-core
sphinx-copybutton==0.5.1
sphinx-copybutton==0.5.2
# via rocm-docs-core
sphinx-design==0.3.0
sphinx-design==0.6.0
# via rocm-docs-core
sphinx-external-toc==0.3.1
sphinx-external-toc==1.0.1
# via rocm-docs-core
sphinx-notfound-page==0.8.3
sphinx-notfound-page==1.0.2
# via rocm-docs-core
sphinxcontrib-applehelp==1.0.4
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-devhelp==1.0.6
# via sphinx
sphinxcontrib-htmlhelp==2.0.1
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-qthelp==1.0.7
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
tqdm==4.66.1
tomli==2.0.1
# via sphinx
tqdm==4.66.4
# via mpire
typing-extensions==4.5.0
# via pydata-sphinx-theme
urllib3==1.26.18
# via requests
wrapt==1.15.0
# via deprecated
zipp==3.17.0
typing-extensions==4.12.2
# via
# pydata-sphinx-theme
# pygithub
urllib3==2.2.1
# via
# importlib-metadata
# importlib-resources
# pygithub
# requests
wrapt==1.16.0
# via deprecated
28 changes: 26 additions & 2 deletions include/rocm_smi/rocm_smi.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,6 @@ typedef rsmi_clk_type_t rsmi_clk_type;
*/
typedef enum {
RSMI_COMPUTE_PARTITION_INVALID = 0,
RSMI_COMPUTE_PARTITION_CPX, //!< Core mode (CPX)- Per-chip XCC with
//!< shared memory
RSMI_COMPUTE_PARTITION_SPX, //!< Single GPU mode (SPX)- All XCCs work
//!< together with shared memory
RSMI_COMPUTE_PARTITION_DPX, //!< Dual GPU mode (DPX)- Half XCCs work
Expand All @@ -377,6 +375,8 @@ typedef enum {
//!< work together with shared memory
RSMI_COMPUTE_PARTITION_QPX, //!< Quad GPU mode (QPX)- Quarter XCCs
//!< work together with shared memory
RSMI_COMPUTE_PARTITION_CPX //!< Core mode (CPX)- Per-chip XCC with
//!< shared memory
} rsmi_compute_partition_type_t;
/// \cond Ignore in docs.
typedef rsmi_compute_partition_type_t rsmi_compute_partition_type;
Expand Down Expand Up @@ -4053,6 +4053,30 @@ rsmi_dev_compute_partition_set(uint32_t dv_ind,
*/
rsmi_status_t rsmi_dev_compute_partition_reset(uint32_t dv_ind);

/**
* @brief Retrieves the partition_id for a desired device
*
* @details
* Given a device index @p dv_ind and a uint32_t pointer @p partition_id ,
* this function will attempt to obtain the device's partition ID.
* Upon successful retreival, the obtained device's partition will be stored
* in the passed @p partition_id uint32_t variable. If device does
* not support partitions or is in SPX, a @p partition_id ID of 0 shall
* be returned.
*
* @param[in] dv_ind a device index
*
* @param[inout] partition_id a uint32_t variable,
* which the device's partition_id will be written to.
*
* @retval ::RSMI_STATUS_SUCCESS call was successful
* @retval ::RSMI_STATUS_INVALID_ARGS the provided arguments are not valid
* @retval ::RSMI_STATUS_NOT_SUPPORTED installed software or hardware does not
* support this function
*
*/
rsmi_status_t rsmi_dev_partition_id_get(uint32_t dv_ind, uint32_t *partition_id);

/** @} */ // end of ComputePartition

/*****************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion include/rocm_smi/rocm_smi_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ class ScopeGuard {
__forceinline ~ScopeGuard() {
if (!dismiss_) release_();
}
__forceinline ScopeGuard& operator=(const ScopeGuard& rhs) {
__forceinline ScopeGuard& operator=(ScopeGuard& rhs) {
dismiss_ = rhs.dismiss_;
release_ = rhs.release_;
rhs.dismiss_ = true;
Expand Down
Loading

0 comments on commit 5ac86f6

Please sign in to comment.