You can compile a different logp function by hand, but actually Slice already doing that as @ricardoV94 said above. Basically, for Slice sampling (and any compound step, see Compound Steps in Sampling — PyMC3 3.11.5 documentation), the log_prob function each Step method using is a conditional log_prob.