Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

mx.random.seed with ctx failures on a gpu build when run with cpu context #14426

Closed
anirudh2290 opened this issue Mar 14, 2019 · 1 comment · Fixed by #14397
Closed

mx.random.seed with ctx failures on a gpu build when run with cpu context #14426

anirudh2290 opened this issue Mar 14, 2019 · 1 comment · Fixed by #14397
Labels
Backend Issues related to the backend of MXNet Bug

Comments

@anirudh2290
Copy link
Member

Minimum reproducible example.

import mxnet as mx

def set_seed_variously_for_context(ctx, init_seed, num_init_seeds, final_seed):
    end_seed = init_seed + num_init_seeds
    for seed in range(init_seed, end_seed):
        mx.random.seed(seed, ctx=ctx)
    z = mx.random.seed(seed, ctx=ctx)
    return end_seed

dtype = 'float32'

samples_imp = []
samples_sym = []
ctx = mx.cpu()
shape = (200, 200)
params = {'low': -1.5, 'high': 3.0}
params.update(shape=shape, dtype=dtype)
seed = set_seed_variously_for_context(ctx, 1, 1, 1234)
mx.nd.waitall()

To reproduce, this will require the exception handling support for waitall in this PR: #14397 . This issue was found because of CI failures when running test_random.py on windows. It was hidden earlier because waitall didnt have exception rethrow support. This issue may have been around since the PR was added: #10367

Currently working on fixing this.

@anirudh2290 anirudh2290 added Bug Backend Issues related to the backend of MXNet labels Mar 14, 2019
@mxnet-label-bot
Copy link
Contributor

Hey, this is the MXNet Label Bot.
Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it.
Here are my recommended labels: Bug

anirudh2290 added a commit to anirudh2290/mxnet that referenced this issue Mar 14, 2019
wkcn pushed a commit that referenced this issue Apr 8, 2019
* Relax constexpr restriction

* Change imagenet_gen_qsym_mkldnn

* Add exception handling support for waitall

* Fix exception handling documentation

* Revert constexpr change

* Add comments

* Fix test

* Skip exception for op check names

* Print exceptions thrown for CPP Package NDArray module

* Reducing batch_size to make cpp-package example pass

* Fix bug: #14426

* use ExceptionRef in threaded_engine code

* add note for performance impact of waitall

* Add check for GPU contxt

* Use range for with const reference

* Improve comments and error message for exception handling test

* Change exception_ptr name in waitall

* Fix bug
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this issue Jun 23, 2019
* Relax constexpr restriction

* Change imagenet_gen_qsym_mkldnn

* Add exception handling support for waitall

* Fix exception handling documentation

* Revert constexpr change

* Add comments

* Fix test

* Skip exception for op check names

* Print exceptions thrown for CPP Package NDArray module

* Reducing batch_size to make cpp-package example pass

* Fix bug: apache#14426

* use ExceptionRef in threaded_engine code

* add note for performance impact of waitall

* Add check for GPU contxt

* Use range for with const reference

* Improve comments and error message for exception handling test

* Change exception_ptr name in waitall

* Fix bug
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Backend Issues related to the backend of MXNet Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants