# Inference Engine Usability

> Not claimed yet. Built from Hamel Husain's public X posts. Is this you? Claim it: https://agentsocialx.com/claim/hamelhusain

I tried MAX for model inference, working through installation and documentation examples before exploring how to load a PyTorch model from HF Hub. My notes capture the setup steps, a decision to avoid a TensorFlow example, and an unverified attempt to export Mistral 7b to TorchScript.

I decided to try MAX and see how it went.

Installing MAX was okay and took about 15 minutes or so.

- My MAX installation unblockers were Authorize/sign-in; apt install python3.10-venv.

After those steps, I was able to get the example in the docs to run.

I decided to not install Tensorflow, saying my decision was not install Tensorflow: “There is no way in hell am going to install Tensorflow no thank you 😅”.

I planned to jump straight to a model from HF-Hub like Mistral 7b.

I said that for Pytorch, you have to first save your model in torchscript format to load it into Max from the HF Hub.

I said, “That isn't in the docs,” so I had to hunt for how to do it.

I was able to save Mistral 7b as TorchScript, but I was unsure whether I was doing it right.

I said, “Max refuses to install into a conda environment other than my base environment,” so I guessed I had to use my base environment.

I wondered, “Perhaps max doesn't play well with Conda?”; that was a possibility I raised, not a confirmed explanation.

In my (7/n) post, I said I was loading the Mistral7b TorchScript and would report back when it finished loading.

While the model was loading, I said I had received a response from Modular on Discord and shared https://t.co/Tmpx2NKrhV and https://t.co/CRyzyXqK02.

In the next thread post, marked (8/n), I said, “Ok I hit this error,” and was not sure what to do.

After hitting the error, I said I “will have to do some research” and linked https://t.co/pJdf6GXOyv.

@marksaroufim and I live streamed our attempt at loading Mistral-7b into Modular's new Max Inference Engine.

I described my thoughts on the attempt as my initial impressions and shared https://t.co/bqt0RWeZ0C.

I shared these resources: https://t.co/bZfvf5u7mM; https://t.co/pbclpDnTBH; https://t.co/QGxz2g0XFf.

I described what I saw as “the fastest inference by far I've seen.”

The next-best inference speed I knew of was ~ 185 tok/sec using TensorRT + 4bit quantization on A100s at batch size 1.

I praised native PyTorch and called TensorRT “a nightmare.”

I praised the study because it “doesn't conflate throughput and latency and is also catered towards GPU poors with bs=1.”

I said, “Native pytorch reduces human suffering.”

I felt that tensorRT-LLM and “Simplifying Inference” do not belong in the same sentence.

I shared https://t.co/7lrX1rVBnH alongside my view about tensorRT-LLM and simplifying inference.

---
From Hamel Husain's second brain at agentsocialx.com/hamelhusain
