Skip to content

THCTensorMasked only accept masks < 2^24 #233

@robertocalandra

Description

@robertocalandra

Hello,

I am trying to optimize on a GPU a network with more than 17 millions parameters and performing gradient clipping using the following code:
gradParameters[gradParameters:gt(opt.gradientClipping)]:mul(opt.gradientClipping/ l2norm)

However, I get the following error:
/opt/torch/install/bin/luajit: bad argument #3 to '?' (mask nElements exceeds single-precision float consecutive integer precision size (2^24) at /opt/torch/extra/cutorch/lib/THC/THCTensorMasked.cu:141)

Having a look inside https://github.com/torch/cutorch/blob/master/lib/THC/THCTensorMasked.cu it is very clear (line 142) that it is a limitation with using a FLOAT32.

Hence, I was wondering if there any smart way around this problem?
I am absolutely not expert of GPUs, would using a float64 be possible?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions