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)
- Conda Release supporting Windows + Python 3.11 HOT 3
- Tensorflow Building from Source Code HOT 1
- which version of keras is used by latest kws_streaming HOT 4
- Convert TFlite buffer created using TF1 to TF2 TFlite buffer HOT 1
- How to contribute?
- Error in computation = RQAComputation.create(settings, verbose=True) when I use HPC. However, I do not encounter any error when I use my personal laptop for the same code and installing the same package : from pyrqa.computation import RQAComputation
- I think we should use a separate api token named for this view. We may have additional clients of the APIs in the future, and we should be able to make the decision to limit one of the other of these endpoints from those additional clients. HOT 2
- Why doesn't `The calling iterator did not fully read the dataset being cached.` appear on Google Colab? HOT 2
- How to turn off mlir during tensorflow2.13 compilation? HOT 1
- Running the same model in TF and TFLiteMicro produces different outputs
- TF-Keras mixed precision training leads to autograph errors HOT 2
- Exception encountered: Unrecognized keyword arguments: ['batch_shape'] HOT 5
- Profiler does not Seem to Output Timesteps in xplane.pb - "No step marker observed and hence the step time is unknown" from Tensorboard HOT 3
- Tensorflow compatibility with pyinstaller HOT 2
- Memory leak when jit compiling
- Add support for TensorRT 10
- `tensorflow::RunOptions::RunOptions(void)` symbol missing in built tensorflow.dll (Windows)
- Cannot find any way to install tensorflow<=2.15.0 HOT 3
- Suspected Corner Case in XLA Compilation - vectorized_sum, conditional, scatter_nd_update Complains about Dynamic Shape when we should Know it
- is_installed check for tensorflow-cpu failed as 'spec is None'
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.