Skip to content

Conversation

@tqchen
Copy link
Member

@tqchen tqchen commented Aug 6, 2025

This PR phases out getattar based attribute handling as they are slower and introduces extra code path.

This does mean that if an Object is not explicitly registered in python side, we will no longer be able to access the field by name. Likely this is also desirable as we would like to enable faster use that updates the python end and do not rely on these behavior.

@tqchen tqchen changed the title [REFACTOR] Phase out getattr based attribute handling [FFI][REFACTOR] Phase out getattr based attribute handling Aug 6, 2025
@tqchen tqchen force-pushed the refl-clean branch 5 times, most recently from 248a895 to 236f6c9 Compare August 6, 2025 13:52
This PR phases out getattar based attribute handling as they are slower
and introduces extra code path.

This does mean that if an Object is not explicitly registered
in python side, we will no longer be able to access the field by name.
Likely this is also desirable as we would like to enable faster use that
updates the python end and do not rely on these behavior.
@MasterJH5574 MasterJH5574 merged commit a3ee592 into main Aug 6, 2025
13 checks passed
@tqchen
Copy link
Member Author

tqchen commented Aug 6, 2025

Note for upgrade

  • If an object is not registered in python side and returned, it will results in a warning, and very likely we no longer will be able to access its field in python side
    • Note that previous fallback access is very slow and is not desirable
  • Solution is to expose the object(and the base object if they also have members) via @register_object

@tqchen tqchen deleted the refl-clean branch August 6, 2025 22:24
ShiboXing pushed a commit to ShiboXing/tvm that referenced this pull request Aug 10, 2025
)

[REFACTOR] Phase out getattr based attribute handling

This PR phases out getattar based attribute handling as they are slower
and introduces extra code path.

This does mean that if an Object is not explicitly registered
in python side, we will no longer be able to access the field by name.
Likely this is also desirable as we would like to enable faster use that
updates the python end and do not rely on these behavior.
tqchen added a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
)

[REFACTOR] Phase out getattr based attribute handling

This PR phases out getattar based attribute handling as they are slower
and introduces extra code path.

This does mean that if an Object is not explicitly registered
in python side, we will no longer be able to access the field by name.
Likely this is also desirable as we would like to enable faster use that
updates the python end and do not rely on these behavior.
tqchen added a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
)

[REFACTOR] Phase out getattr based attribute handling

This PR phases out getattar based attribute handling as they are slower
and introduces extra code path.

This does mean that if an Object is not explicitly registered
in python side, we will no longer be able to access the field by name.
Likely this is also desirable as we would like to enable faster use that
updates the python end and do not rely on these behavior.
tqchen added a commit to tqchen/tvm that referenced this pull request Sep 13, 2025
)

[REFACTOR] Phase out getattr based attribute handling

This PR phases out getattar based attribute handling as they are slower
and introduces extra code path.

This does mean that if an Object is not explicitly registered
in python side, we will no longer be able to access the field by name.
Likely this is also desirable as we would like to enable faster use that
updates the python end and do not rely on these behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants