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

examples/bert/build.py does not use model weights #2197

Closed
1 of 4 tasks
tkhanipov opened this issue Sep 5, 2024 · 2 comments
Closed
1 of 4 tasks

examples/bert/build.py does not use model weights #2197

tkhanipov opened this issue Sep 5, 2024 · 2 comments
Labels
bug Something isn't working stale

Comments

@tkhanipov
Copy link

System Info

Currently the example TensorRT LLM engine builder for Bert models simply ignores model weights if those are present in the model directory, it only reads the config.json file, making it essentially impossible to generate a working engine from a pretrained model.

A possible fix is available in #2187

Who can help?

@byshiue

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

Scenario 1 (simplest)

  1. Prepare a pre-trained model (i.e. have a directory with config.json and the weights file).
  2. Replace the weights file with some random content (e.g. any text file).
  3. Run examples/bert/build.py --model_dir input_model

Scenario 2 (use of the weights)

  1. Prepare a pre-trained model (i.e. have a directory with config.json and the weights file).
  2. Run examples/bert/build.py --model_dir input_model
  3. Execute the generated TensorRT LLM engine with some input and check the output tensor.
  4. Execute the input model with the same input and check the output tensor.

Expected behavior

Scenario 1 (simplest)

build.py shall show an error message complaining about invalid weights file.

Scenario 2 (use of the weights)

The output tensors shall have numerically close components.

actual behavior

Scenario 1 (simplest)

build.py finished successfully, generating bert_outputs/config.json and bert_outputs/BertModel_float16_tp1_rank0.engine.

Scenario 2 (use of the weights)

The output tensors look totally unrelated and different from each other.

additional notes

The problem is that the script code only loads the config and does not do anything to load the weights. The fix is available in #2187.

Copy link

github-actions bot commented Oct 6, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 15 days."

@github-actions github-actions bot added the stale label Oct 6, 2024
Copy link

This issue was closed because it has been stalled for 15 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

1 participant