Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exceptions have a hardcoded message #17291

Closed
driazati opened this issue Feb 20, 2019 · 5 comments
Closed

Exceptions have a hardcoded message #17291

driazati opened this issue Feb 20, 2019 · 5 comments
Assignees
Labels
high priority oncall: jit Add this issue/PR to JIT oncall triage queue weeks
Projects

Comments

@driazati
Copy link
Contributor

driazati commented Feb 20, 2019

raise statements in the JIT always raise with the string "Exception". They should instead use the user supplied arguments

Example

@torch.jit.script
def fn(x):
    # type: (int) -> int
    if x > 2:
        raise RuntimeError("bad input, {} is too high".format(x))
    return x + 3

print(fn.graph)
print(fn(4))

Outputs the graph

graph(%x : int):
  %3 : string = prim::Constant[value="Exception"]()
  %1 : int = prim::Constant[value=2]()
  %5 : int = prim::Constant[value=3]()
  %2 : bool = aten::gt(%x, %1)
   = prim::If(%2)
    block0():
       = prim::RaiseException(%3)
      -> ()
    block1():
      -> ()
  %6 : int = aten::add(%x, %5)
  return (%6)

cc @ezyang @gchanan @zou3519 @suo @gmagogsfm

@driazati driazati added the oncall: jit Add this issue/PR to JIT oncall triage queue label Feb 20, 2019
@suo suo added the low priority We're unlikely to get around to doing this in the near future label Mar 11, 2019
@suo suo added the jit-backlog label Oct 3, 2019
@eellison eellison added high priority and removed jit-backlog low priority We're unlikely to get around to doing this in the near future labels Jul 14, 2020
@github-actions github-actions bot added this to Need triage in JIT Triage Jul 14, 2020
@eellison eellison moved this from Need triage to HIGH PRIORITY in JIT Triage Jul 14, 2020
@jansel
Copy link
Contributor

jansel commented Jul 14, 2020

In progress PR for this that got dropped.

@suo suo moved this from HIGH PRIORITY to In progress in JIT Triage Jul 14, 2020
@suo suo moved this from In progress to HIGH PRIORITY in JIT Triage Jul 14, 2020
@eellison
Copy link
Contributor

eellison commented Jul 14, 2020

#34112 is the PR that was about ready to go and dropped

@gmagogsfm gmagogsfm moved this from HIGH PRIORITY to In progress in JIT Triage Jul 20, 2020
@suo
Copy link
Member

suo commented Jul 28, 2020

@gmagogsfm is there a linked PR for this?

@gmagogsfm gmagogsfm linked a pull request Jul 28, 2020 that will close this issue
@gmagogsfm
Copy link
Contributor

@gmagogsfm is there a linked PR for this?

yes, added

@gmagogsfm
Copy link
Contributor

PR merged, closing.

JIT Triage automation moved this from In progress to Done Aug 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high priority oncall: jit Add this issue/PR to JIT oncall triage queue weeks
Projects
JIT Triage
  
Done
Development

Successfully merging a pull request may close this issue.

5 participants