def METHOD_NAME(self, model_stat):
    recorded_gpu_usage = 0
    for usage in model_stat["memory_usage"]:
        if usage["type"] == "GPU":
            recorded_gpu_usage += int(usage["byte_size"])
    # unload and verify recorded usage
    before_total_usage = self.report_used_gpu_memory()
    self.client_.unload_model(model_stat["name"])
    # unload can return before the model is fully unloaded,
    # wait to be finished
    time.sleep(2)
    usage_delta = before_total_usage - self.report_used_gpu_memory()
    # check with tolerance as gpu usage obtained is overall usage
    self.assertTrue(
        usage_delta * 0.9 <= recorded_gpu_usage <= usage_delta * 1.1,
        msg="For model {}, expect recorded usage to be in range [{}, {}], got {}".format(
            model_stat["name"],
            usage_delta * 0.9,
            usage_delta * 1.1,
            recorded_gpu_usage,
        ),
    )