Skip to content

Conversation

@eclipse1605
Copy link

Description

fixed a failure in derived scan logprob construction when the observed/value tensor provides more static broadcastability information than the generative scan graph (e.g. observed has a size-1 axis like (date, 1) while the scan state was inferred as non broadcastable on that axis).

in this, model.logp() could fail during the measurable scan rewrite with a scan outputs_info broadcast pattern mismatch (scan output inferred as matrix like vs. outputs_info expecting vector-like).

  • the scan logprob rewrite propagate/align broadcastability metadata introduced by observed/value variables so the rewritten scan is internally consistent.
  • this happens without turning scan inner placeholders into non nominal Apply nodes (so scan reconstruction remains valid).

note

I think the same idea can be generalized by treating static broadcastability metadata as part of the measurable scan rewrite contract:

  • identify the “outer” value/observed variables that participate in the measurable rewrite and extract their broadcastable axes (ignoring the time axis for sequences).
  • when creating inner scan placeholders / outputs_info proxies for the logprob rewritten scan, ensure their TensorType.shape reflects any size-1/broadcastable axes implied by the outer variables.
  • apply the same normalization to tapped init buffers (pt.join / outputs_info) so that init and scan outputs agree on broadcastability, without inserting broadcast Apply nodes into the inner graph (placeholders must remain nominal vars).

Related Issue

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Derived scan logprob fails when observed data provides more broadcastable information than generative graph

1 participant