You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OneFlow does not properly validate data types during tensor arithmetic involving int8 tensors. Specifically, performing an operation like int8_tensor + "a" (string) leads to a segmentation fault, rather than raising a TypeError. This is a severe robustness bug, as such input should never reach the backend and crash the process.
Code to reproduce bug
importoneflowasflowimportnumpyasnp# Set fixed seed for reproducibilitynp.random.seed(42)
# Create an int8 tensor representing ASCII characterschar_map= [ord(c) forcin"abcdefgh"]
char_tensor=flow.tensor(char_map, dtype=flow.int8)
print(char_tensor)
# Valid operationschar_tensor+1char_tensor+flow.tensor([1], dtype=flow.int8)
char_tensor*flow.tensor([2], dtype=flow.int8)
char_tensor.reshape(-1, 2)
print(char_tensor)
# Invalid operations# This should raise an exception, not crashprint(char_tensor+0.5) # Implicit promotion, should be fineprint(char_tensor+"a") # ❌ This causes segmentation fault
Summary
OneFlow does not properly validate data types during tensor arithmetic involving
int8
tensors. Specifically, performing an operation likeint8_tensor + "a"
(string) leads to a segmentation fault, rather than raising aTypeError
. This is a severe robustness bug, as such input should never reach the backend and crash the process.Code to reproduce bug
output:
System Information
OneFlow installation: pip
OS: Ubuntu 20.04
OneFlow version (run python3 -m oneflow --doctor):
Python version: 3.8
CUDA driver version: 11.6
GPU models: NVIDIA A16
The text was updated successfully, but these errors were encountered: