Comments (6)
Looks to me like the sobol operation has a couple overflow checks for skip
and num_results + skip
, though they don't always get triggered (as in the example given in the issue description)
import tensorflow as tf
int32max = 2147483647
testcases = [(1, int32max), (1, int32max+1), (int32max, int32max), (1, int(1e5)), (1, int(1e10)), (1, int(1e15)), (1, int(1e20))]
for num_results, skip in testcases:
try:
a = float(tf.math.sobol_sample(1, num_results, skip))
print(f"computed {a} for num_results={num_results}, skip={skip}")
except Exception as err:
print(f"error computing for num_results={num_results}, skip={skip}: {err}")
Console output on my laptop:
error computing for num_results=1, skip=2147483647: num_results+skip must be less than 2147483647 [Op:SobolSample]
error computing for num_results=1, skip=2147483648: skip must be non-negative [Op:SobolSample]
error computing for num_results=2147483647, skip=2147483647: num_results+skip must be less than 2147483647 [Op:SobolSample]
computed 0.5610733032226562 for num_results=1, skip=100000
computed -0.5015935897827148 for num_results=1, skip=10000000000
error computing for num_results=1, skip=1000000000000000: skip must be non-negative [Op:SobolSample]
error computing for num_results=1, skip=100000000000000000000: Can't convert Python sequence with out-of-range integer to Tensor.
from tensorflow.
This thread argues signed integer input overflow is not the responsibility of Tensorflow to check unless it causes system crash.
It may be worth nonetheless extending the unit tests for those overflow checks that are implemented in https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/kernels/sobol_op.cc#L137.
from tensorflow.
@nfergu Though I was able to replicate the issue reported here, could you please try reducing the skip value. Smaller skip values require less complex calculations and might avoid overflow.
Thank you!
from tensorflow.
@sushreebarsa Thanks! We already reduced the skip value, as you suggested. Weβre happy with this workaround.
from tensorflow.
@nfergu Thank you for the response!
Could you please move this issue to closed status if the workaround works for you?
Thank you!
from tensorflow.
Are you satisfied with the resolution of your issue?
Yes
No
from tensorflow.
Related Issues (20)
- Installing tensorflow for CUDA and ROCM within the same Python installation HOT 4
- Building TFLite fails on nnapi_delegate requiring C++20 extensions HOT 5
- Check failed: ret == 0 (11 vs. 0)Thread tf_data_private_threadpool creation via pthread_create() failed. Aborted (core dumped) HOT 2
- issue of conversion HOT 3
- TfLite C/C++ shared library via Bazel HOT 5
- tensorflow_model_optimization,quantization.keras.quantize_model raises exception on its documentation example HOT 4
- tensorflow not utilizing gpu memory and stating limit is 137gb HOT 4
- deprecation module not import HOT 2
- Tf_nightly fails to install in docker
- TF-TRT Warning: Could not find TensorRT HOT 9
- Generating Images with BigGAN -- demo in docs no longer compatible with tensorflow (hub?) HOT 4
- tf Normalization HOT 2
- efficient_serving.ipynb has some bugs HOT 2
- JUCE LNK2001 - LNK2019: UNRESOLVED EXTERNAL SYMBOL HOT 1
- tensorflow:Entity <function Function._initialize_uninitialized_variables.<locals>.initialize_variables at 0x000001F58F9464C8> could not be transformed and will be executed as-is. HOT 4
- What is the effect of TF_GUARDED_BY(mu) for variables like Tensor? HOT 2
- `SystemError` in `tf.constant` when `dtype` is `tf.uint64` and `value` is nagetive. HOT 7
- poetry can't find the right installation candidate of tensorflow with python 3.11 HOT 4
- Too slow while fetching @llvm-raw repos while building tensorflow from Source HOT 4
- Tensorflow not detecting GPU HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tensorflow.