BMG issue with "Internal compiler error in edge requirements checking:"
See original GitHub issueIssue Description
Running the simple model below with BMG raises a
beanmachine.ppl.compiler.internal_error.InternalError: Internal compiler error in edge requirements checking:
Node of type BetaNode is being checked for requirements but the lattice typer is unable to assign it a type. Requirements checking always needs to know the lattice type of a node when checking requirements on its outgoing edges.
Replacing dist.Bernoulli(1 - self.Probability())
by dist.Bernoulli(self.Probability())
removes the error which looks strange (but it is another model…).
Replacing return dist.Beta(self.MetaParameter() + 0.1, self.MetaParameter() + 0.1)
by return dist.Beta(0.1, self.MetaParameter() + 0.1)
changes the error to ValueError: Beta parents must be positive real-valued
Steps to Reproduce
import beanmachine.ppl as bm
import torch
import torch.distributions as dist
class Model:
@bm.random_variable
def MetaParameter(self):
return dist.Uniform(0, 1)
@bm.random_variable
def Probability(self):
return dist.Beta(self.MetaParameter() + 0.1, self.MetaParameter() + 0.1)
@bm.random_variable
def Observation(self):
return dist.Bernoulli(1 - self.Probability())
model = Model()
samples = bm.inference.BMGInference().infer(
queries=[model.MetaParameter()],
observations={model.Observation(): torch.tensor(1)},
num_samples=1000,
num_chains=2,
)
Expected Behavior
I would expect the code to run correctly. Is there some documentation on how to add new rules to the lattice typer ?
System Info
Please provide information about your setup
- PyTorch Version (run
print(torch.__version__)
: 1.10.1+cpu - Python version: 3.8.12 (default, Oct 12 2021, 03:01:40) [MSC v.1916 64 bit (AMD64)]
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Internal compiler error. Aborting! · Issue #176 - GitHub
The problem is on the attached part of the model. I think that is not the input resolution. I still get an "internal...
Read more >Internal compiler error in a simple code
A fix for this issue has been internally implemented and is being prepared for release on VS17.0 Preview 4. We'll update you once...
Read more >Nastran Dmap Error Message List - Siemens PLM
INTERNAL NDDL DATA CODE 11 GENERALLY INDICATES AN. NDDL COMPILATION ERROR USING THE "SAMEAS" OPTION. VERIFY RECORDS DESCRIBED AS "SAMEAS" APPEAR AFTER THE....
Read more >Resolving Internal Errors (C++) - RAD Studio
What to do if you encounter an internal compiler error · Remember that your code may not be at fault. · Try a...
Read more >LI77585: INTERNAL COMPILER ERROR WITH -qhot -qsmp
The Internal Compiler Error is caused by out of memory mishandling. Adding -qmaxmem=-1 will enable the compiler to use more memory and complete...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I confirm it works when replacing Uniform with Beta, tx a lot!
Thank you for taking the time to write this detailed comment, very instructive !