Skip to content

[BUG]: numba-cuda errors related to ObjectCode pickling #1671

Closed

Description

@Andy-Jost

Is this a duplicate?

Type of Bug

Runtime Error

Component

cuda.core

Describe the bug

Possibly related to cloudpickle. PR #1660 fixed issues related to ObjectCode and IPC. This item it to collect a reproducer and add something to the cuda.core tests.

@brandon-b-miller Please upload a reproducer.

How to Reproduce

TBD

Expected behavior

Serialization of cuda.core core objects should succeed.

Operating System

No response

nvidia-smi output

No response

Activity

  1. added this to the cuda.core v0.7.0 milestone on Feb 20, 2026
  2. added theissue type on Feb 20, 2026
  3. kkraus14 commented on Feb 23, 2026

    @kkraus14
    Collaborator

    Was this fixed by #1660?

  4. Andy-Jost commented on Feb 23, 2026

    @Andy-Jost
    ContributorAuthor

    Yes. The description needs to be improved. This item is to get a testcase to include in our unit tests.

  5. brandon-b-miller commented on Mar 23, 2026

    @brandon-b-miller
    Contributor

    Repro here:

    import io
    import pickle
    
    import cloudpickle
    
    _MINIMAL_PTX = b""".version 8.0
    .target sm_52
    .address_size 64
    """
    
    
    from cuda.core import ObjectCode
    obj = ObjectCode.from_ptx(_MINIMAL_PTX)
    
    pickle.dumps(obj)
    print("pickle.dumps(ObjectCode): ok")
    
    with io.BytesIO() as buf:
        p = cloudpickle.CloudPickler(buf, protocol=4)
        p.dump(obj)
    _pickle.PicklingError: Can't pickle <cyfunction ObjectCode._reduce_helper at 0x7f85a0364fc0>: it's not the same object as cuda.core._module.ObjectCode._reduce_helper
    
  6. added a commit that references this issue on Mar 23, 2026
    7a566f5
  7. added a commit that references this issue on Mar 23, 2026
    653939e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions