question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BMG issue with "Internal compiler error in edge requirements checking:"

See original GitHub issue

Issue 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:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
sdementencommented, Jan 25, 2022

I confirm it works when replacing Uniform with Beta, tx a lot!

1reaction
sdementencommented, Feb 15, 2022

Thank you for taking the time to write this detailed comment, very instructive !

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found