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

exe crash without an error description #12884

Open
SparkLena opened this issue Feb 24, 2025 · 2 comments
Open

exe crash without an error description #12884

SparkLena opened this issue Feb 24, 2025 · 2 comments

Comments

@SparkLena
Copy link

Hello:

During the pyinstaller packaging process, it was found that self.model = self.model.half().to("xpu") caused the exe to crash without an error description. How to fix it?

package error:
2025-02-24 17:04:58,046 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,046 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,048 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,049 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,050 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,050 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,051 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,053 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,054 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,055 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,056 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,056 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,058 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,059 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,070 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,070 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,075 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,075 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,081 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,081 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,082 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,083 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,084 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,085 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,087 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,088 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,089 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,090 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,091 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,093 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,099 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,100 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,101 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,101 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,102 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,103 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack
2025-02-24 17:04:58,104 - ipex_llm.utils.common.log4Error - ERROR -

****Usage Error
intel_extension_for_pytorch has already been automatically imported. Please avoid importing it again!
2025-02-24 17:04:58,104 - ipex_llm.utils.common.log4Error - ERROR -

***Call Stack

@qiuxin2012
Copy link
Contributor

Can you provide a mininal codeblock to reproduce your error?

@SparkLena
Copy link
Author

SparkLena commented Feb 25, 2025

Can you provide a mininal codeblock to reproduce your error?
Thanks for the reply, here's the code example.

def script_method(fn, _rcb=None):
    return fn


def script(obj, optimize=True, _frames_up=0, _rcb=None):
    return obj


import torch.jit
script_method1 = torch.jit.script_method
script1 = torch.jit.script
torch.jit.script_method = script_method
torch.jit.script = script




import os
import uvicorn
from fastapi import FastAPI
app = FastAPI()

from fastapi.middleware.cors import CORSMiddleware



app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"], 
    allow_credentials=True,
    allow_methods=["*"],  
    allow_headers=["*"],  
)

from pydantic import BaseModel
class GPTQuery(BaseModel):
    question:str



os.environ['SYCL_CACHE_PERSISTENT'] = '1'
os.environ['BIGDL_LLM_XMX_DISABLED'] = '1'
import torch
import time
from ipex_llm.transformers import AutoModelForCausalLM
from transformers import AutoTokenizer



class LargeModel:
    def __init__(self, model_name=''):
        self.path = os.path.dirname(os.path.abspath(__file__))
        self.path = self.path.replace("\\","/")
        self.path = '/'.join([self.path, "Qwen2.5-1.5B-Instruct/"])
        print("model path:" + self.path)

        self.tokenizer = AutoTokenizer.from_pretrained(self.path,
                                              trust_remote_code=True)

        self.model =  AutoModelForCausalLM.from_pretrained(self.path,
                                                 load_in_4bit=True,
                                                 optimize_model=True,
                                                 trust_remote_code=True,
                                                 use_cache=True)
        # open exe crash
        # self.model = self.model.half().to("xpu")

large_model = LargeModel()


if __name__ == '__main__':

    import time
    print(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()))

    # uvicorn.run(app,host='127.0.0.1',port = 8000,log_level='debug')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants