Skip to content

Not detecting need for recompilation triggered by keyword arguments #2182

@albi3ro

Description

@albi3ro

qjit is not detecting the need for recompilation when keyword arguments change shape.

For example:

@qml.qjit
def f(x, y):
    return x + y
>>> f(1, y=2), f(1, y=jnp.array([2,2]))
(Array(3, dtype=int64), Array(3, dtype=int64))
>>> # redefine f
>>> f(1, y=jnp.array([3, 3])), f(1, y=2)
(Array([4, 4], dtype=int64), Array([3, 1], dtype=int64))

I would expect the behaviour with keyword arguments to match the behaviour where everything is passed positionally.

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