Skip to content

Commit

Permalink
style: add commnet and fix copyright
Browse files Browse the repository at this point in the history
  • Loading branch information
GuanLuo committed Oct 23, 2024
1 parent 66f3c75 commit 6a87c5f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/python/library/build_wheel.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright 2021-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2021-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down
2 changes: 1 addition & 1 deletion src/python/library/tritonclient/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright 2020-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ def create_shared_memory_region(triton_shm_name, shm_key, byte_size, create_only
_key_mapping[shm_key] = [False, 0]
_key_mapping[shm_key][1] += 1
except FileNotFoundError:
# File not found means the shared memory region has not been created,
# suppress the exception and attempt to create the region.
pass
if shm_handle._mpsm_handle is None:
try:
Expand Down Expand Up @@ -137,6 +139,8 @@ def set_shared_memory_region(shm_handle, input_values, offset=0):

try:
for input_value in input_values:
# numpy array of object type is "syntactic sugar" for the API, should
# be handled by accessing its item and treat as Python object
if input_value.dtype == np.object_:
byte_size = len(input_value.item())
shm_handle._mpsm_handle.buf[offset : offset + byte_size] = (
Expand Down

0 comments on commit 6a87c5f

Please sign in to comment.