Skip to content

Commit e0ba49f

Browse files
committed
cleanup code
Signed-off-by: Ceng23333 <441651826@qq.com>
1 parent c0cbec6 commit e0ba49f

9 files changed

Lines changed: 1 addition & 110 deletions

examples/collect_metrics_longtext_decode.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@
2626
from typing import Any, Callable, Dict, List, Optional, Tuple
2727

2828
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../python"))
29-
try:
30-
from infllmv2_loader import preload_infllmv2_if_available
31-
32-
preload_infllmv2_if_available()
33-
except Exception:
34-
pass
3529

3630

3731
def _poll_gpu_mem_mib(stop: threading.Event, gpu_index: int, out: List[int]) -> None:

examples/compare_inference_speed.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@
2626

2727
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../python"))
2828

29-
try:
30-
# Best-effort InfLLM-v2 preload to avoid requiring LD_PRELOAD in
31-
# profiling tools like nsys. Safe when infllm_v2 is absent.
32-
from infllmv2_loader import preload_infllmv2_if_available as _preload_infllmv2_if_available
33-
except Exception: # pragma: no cover - defensive import guard
34-
_preload_infllmv2_if_available = None
35-
36-
if _preload_infllmv2_if_available is not None:
37-
_preload_infllmv2_if_available()
38-
3929
def _build_chat_input_ids(tokenizer, prompt: str):
4030
conversation = [{"role": "user", "content": prompt}]
4131
text = tokenizer.apply_chat_template(

examples/eval_tasks/mmlu_pro_val/mmlu_pro_val_step_trace.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
import torch
1313
from transformers import AutoModelForCausalLM, AutoTokenizer
1414

15-
from infinilm.infllmv2_loader import preload_infllmv2_if_available
16-
17-
preload_infllmv2_if_available()
18-
1915
import infinicore
2016
from infinilm.cache import StaticKVCacheConfig
2117
from infinilm.distributed import DistConfig

examples/metrics_16k_prefill.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ nsys stats --report nvtx_sum --format table ${OUT}/infinilm_prefill_16k.nsys-rep
101101

102102
When profiling with `nsys`, setting `LD_PRELOAD` to the `infllm_v2` extension can break `nsys` itself (loader errors from PyTorch's `libtorch_python.so`). To make `nsys profile ... python ...` work reliably, we preload the InfLLM-v2 `.so` **inside Python** (RTLD_GLOBAL) before importing `infinicore`, so that `libinfinicore_cpp_api.so` can resolve `mha_varlen_fwd` / `mha_fwd_kvcache` without using `LD_PRELOAD`.
103103

104-
- **Added helper**: `InfiniLM/python/infllmv2_loader.py`
104+
- **Note**: InfLLM-v2 is now linked normally via InfiniCore build; no Python-side preload helper is required.
105105
- **Wired into scripts** (preload before `import infinicore`):
106106
- `InfiniLM/examples/compare_inference_speed.py`
107107
- `InfiniLM/examples/profile_prefill_infinilm_torchprof.py`

examples/minicpm_sala_logits_sanity.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
import torch
77
from transformers import AutoModelForCausalLM, AutoTokenizer
88

9-
from infllmv2_loader import preload_infllmv2_if_available
10-
11-
preload_infllmv2_if_available()
12-
139
import infinicore
1410
from infinilm.distributed import DistConfig
1511
from infinilm.infer_engine import InferEngine

examples/profile_prefill_infinilm_torchprof.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
import torch
66
from transformers import AutoTokenizer
77

8-
from infllmv2_loader import preload_infllmv2_if_available
9-
10-
preload_infllmv2_if_available()
11-
128
import infinicore
139
from infinilm.distributed import DistConfig
1410
from infinilm.infer_engine import InferEngine

python/infinilm/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
from .infllmv2_loader import preload_infllmv2_if_available
2-
3-
# InfiniCore may depend on InfLLM-v2 symbols (mha_varlen_fwd); load extension
4-
# RTLD_GLOBAL before any submodule imports infinicore.
5-
preload_infllmv2_if_available()
6-
71
from .models import AutoLlamaModel
82
from . import distributed
93
from . import cache

python/infinilm/infllmv2_loader.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

python/infllmv2_loader.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)