jax
e4b8959e - [IFRT] Define `UserContext::Id()`

Commit
112 days ago
[IFRT] Define `UserContext::Id()` `xla::ifrt::UserContext::Id()` is a new user context identifier that will supersede `xla::ifrt::UserContext::Fingerprint()`. `Id()` accepts any globally unique ID for a certain context, which is more loose than `Fingerprint()`. The main benefit is that `UserContext` subclasses will no longer be required to compute a fingerprint, which is often very expensive (e.g., computing `PyUserContext`'s fingerprint requires holding GIL). The downside is that any existing user code that expected the number of fingerprints to remain finite and small will be obsolete (e.g., a global registry that permanently keeps `UserContext` based on their fingerprint). However, such user code will be be migrated with subsequent changes so that it is unnecessary to rely on that property and can instead use `xla::ifrt::UserContextRegistry`. PiperOrigin-RevId: 805416360
Author
Parents
Loading