groq / mlagility

Machine Learning Agility (MLAgility) benchmark and benchmarking tools
MIT License
38 stars 11 forks source link

Give benchit users a way to see complete exception stack traces when something goes wrong #39

Closed jeremyfowers closed 1 year ago

jeremyfowers commented 1 year ago

Right now, all exceptions are caught, and the stack trace is discarded. Save it to a file instead of discarding it.

jeremyfowers commented 1 year ago

@danielholanda I'm actually not sure how to test this. What's an example of a program that would throw an exception that would be caught during call_benchit() in analysis.py?

jeremyfowers commented 1 year ago

How to print the stack trace to a file: https://stackoverflow.com/questions/31636884/print-exception-with-stack-trace-to-file

danielholanda commented 1 year ago

program

@danielholanda I'm actually not sure how to test this. What's an example of a program that would throw an exception that would be caught during call_benchit() in analysis.py?

A script that contains multiple models but not all of them pass through all stages of analysis (e.g. one of the models does not conver to ONNX or FP16)

jeremyfowers commented 1 year ago

program

@danielholanda I'm actually not sure how to test this. What's an example of a program that would throw an exception that would be caught during call_benchit() in analysis.py?

A script that contains multiple models but not all of them pass through all stages of analysis (e.g. one of the models does not conver to ONNX or FP16)

@danielholanda that trigger a groqit exception, which we already do an ok job of catching and saving to a log file. But what about this code:

# This broad exception is ok since enumerating all exceptions is
    # not possible, as the tested software continuously evolves.
    except Exception as e:  # pylint: disable=broad-except
        util.stop_stdout_forward()
        model_info.status_message = f"Unknown benchit error: {e}"
        model_info.status_message_color = printing.Colors.WARNING
jeremyfowers commented 1 year ago

Ahhh ok this can be tested by having benchit() raise any exception that isn't a GroqFlow exception. For example if benchmarking fails.