Sorry to bump. I’m curious whether a change to Slice could help resolve this issue for that step method. Could it be possible to change the calls to logp such that Slice doesn’t even calculate the logp for nodes that are not relevant to the parameter being sampled?
Taking a deep deep dive, it looks like old pymc2 does this by keeping calculating logp on the markov blanket of the node(s) that it is sampling (link). Slice sampler just uses the logp function from self.model.compile_logp(). I don’t have a deep familiarity with aesara yet, but it seems like we perhaps we could do the same thing by compiling a different logp function?