OpenMOSS / OpenMOSS/MOSS

int4量化模型,运行一段时间后报错

Open
#325 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
12.3k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

OS: ubuntu
GPU: v100

ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/opt/conda/envs/py38/lib/python3.8/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 254, in run_asgi
result = await self.app(self.scope, self.asgi_receive, self.asgi_send)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in call
return await self.app(scope, receive, send)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/fastapi/applications.py", line 276, in call
await super().call(scope, receive, send)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/starlette/applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/starlette/middleware/errors.py", line 149, in call
await self.app(scope, receive, send)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/starlette/middleware/exceptions.py", line 79, in call
raise exc
File "/opt/conda/envs/py38/lib/python3.8/site-packages/starlette/middleware/exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in call
raise e
File "/opt/conda/envs/py38/lib/python3.8/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/starlette/routing.py", line 718, in call
await route.handle(scope, receive, send)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/starlette/routing.py", line 341, in handle
await self.app(scope, receive, send)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/starlette/routing.py", line 82, in app
await func(session)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/fastapi/routing.py", line 289, in app
await dependant.call(**values)
File "/app/api.py", line 51, in stream_chat
for response in infer.stream_forward(messages, paras):
File "/opt/conda/envs/py38/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 43, in generator_context
response = gen.send(None)
File "/app/moss_inference_extend.py", line 18, in stream_forward
for output_ids in self.stream_sample(
File "/app/moss_inference_extend.py", line 62, in stream_sample
logits, past_key_values = self.infer_(input_ids if i == 0 else new_generated_id, attention_mask, past_key_values)
File "/app/moss_inference.py", line 338, in infer_
outputs: BaseModelOutputWithPast = self.model(**inputs)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/app/models/modeling_moss.py", line 678, in forward
transformer_outputs = self.transformer(
File "/opt/conda/envs/py38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/app/models/modeling_moss.py", line 545, in forward
outputs = block(
File "/opt/conda/envs/py38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/app/models/modeling_moss.py", line 270, in forward
attn_outputs = self.attn(
File "/opt/conda/envs/py38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/app/models/modeling_moss.py", line 164, in forward
qkv = self.qkv_proj(hidden_states)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/app/models/quantization.py", line 367, in forward
out = QuantLinearFunction.apply(x.reshape(-1, x.shape[-1]), self.qweight, self.scales,
File "/opt/conda/envs/py38/lib/python3.8/site-packages/torch/cuda/amp/autocast_mode.py", line 105, in decorate_fwd
return fwd(*args, **kwargs)
File "/app/models/quantization.py", line 279, in forward
output = matmul248(input, qweight, scales, qzeros, g_idx, bits, maxq)
File "/app/models/quantization.py", line 250, in matmul248
matmul_248_kernel[grid](input, qweight, output,
File "/app/models/custom_autotune.py", line 109, in run
return self.fn.run(*args, num_warps=config.num_warps, num_stages=config.num_stages, **kwargs, **config.kwargs)
File "", line 23, in matmul_248_kernel
RuntimeError: Triton Error [CUDA]: device-side assert triggered

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the failing call chain in /app/models/quantization.py, especially matmul248 and QuantLinearFunction, then trace its use from /app/moss_inference.py and /app/moss_inference_extend.py. Reproduce sustained int4 inference on Ubuntu with a V100 and determine what triggers the Triton device-side assert; done means the same workload completes without the error.

Written by the indexing model from the issue text.

Assessment

Tech stack
fastapi, python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.