bab2min / Kiwi

Kiwi(지능형 한국어 형태소 분석기)
https://lab.bab2min.pe.kr/kiwi
Other
403 stars 46 forks source link

GPU server 에서 사용하는 경우 문제가 생길 수 있을까요? #173

Open mook1027 opened 2 weeks ago

mook1027 commented 2 weeks ago

안녕하세요. Kiwi 0.15.2 버전을 JNI를 사용해서 라이브러리(.so)를 만들고 이를 사용하여 자바로 키위를 사용하는 플러그인을 만들었습니다. 이것을 GPU server 에서 사용하는 중 아래와 같은 에러가 발생하였는데요 (매번 같은 곳에서 아래 에러가 발생하지는 않습니다.) 혹시 문제가 될만한 부분이 있는지 문의 드립니다.

A fatal error has been detected by the Java Runtime Environment:

SIGSEGV (0xb) at pc=0x00007f9fa285286f, pid=31, tid=552

JRE version: OpenJDK Runtime Environment Temurin-17.0.8+7 (17.0.8+7) (build 17.0.8+7) Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.8+7 (17.0.8+7, mixed mode, sharing, tiered, compressed class ptrs, g1 gc, linux-amd64) Problematic frame: C [libkiwi_jni.so+0x76a86f] kiwi_res_close+0x15f

Core dump will be written. Default location: /usr/share

An error report file with more information is saved as: logs/hs_err_pid31.log

OS는 ubuntu, cpuinfo 정보는 아래와 같습니다 (64 processor) processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 106 model name : Intel(R) Xeon(R) Gold 6326 CPU @ 2.90GHz stepping : 6 microcode : 0xd0003b9 cpu MHz : 961.994 cache size : 24576 KB physical id : 0 siblings : 32 core id : 0 cpu cores : 16 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 27 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 invpcid_single ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local wbnoinvd dtherm ida arat pln pts avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq rdpid md_clear pconfig flush_l1d arch_capabilities bugs : spectre_v1 spectre_v2 spec_store_bypass swapgs mmio_stale_data eibrs_pbrsb gds bogomips : 5800.00 clflush size : 64 cache_alignment : 64 address sizes : 46 bits physical, 57 bits virtual power management:

nvidia-smi 정보 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 525.147.05 Driver Version: 525.147.05 CUDA Version: 12.0 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 NVIDIA A100 80G... Off | 00000000:34:00.0 Off | 0 | | N/A 64C P0 90W / 300W | 79109MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 1 NVIDIA A100 80G... Off | 00000000:35:00.0 Off | 0 | | N/A 42C P0 50W / 300W | 0MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 2 NVIDIA A100 80G... Off | 00000000:36:00.0 Off | 0 | | N/A 47C P0 73W / 300W | 5227MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 3 NVIDIA A100 80G... Off | 00000000:37:00.0 Off | 0 | | N/A 38C P0 47W / 300W | 0MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 4 NVIDIA A100 80G... Off | 00000000:9B:00.0 Off | 0 | | N/A 47C P0 72W / 300W | 72625MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 5 NVIDIA A100 80G... Off | 00000000:9C:00.0 Off | 0 | | N/A 49C P0 76W / 300W | 16223MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 6 NVIDIA A100 80G... Off | 00000000:9D:00.0 Off | 0 | | N/A 47C P0 72W / 300W | 73421MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+ | 7 NVIDIA A100 80G... Off | 00000000:9E:00.0 Off | 0 | | N/A 48C P0 74W / 300W | 892MiB / 81920MiB | 0% Default | | | | Disabled | +-------------------------------+----------------------+----------------------+

감사합니다.

bab2min commented 2 weeks ago

안녕하세요 @mook1027 Kiwi에서 GPU를 감지하여 다른 동작을 하는 메커니즘이 있는 건 아닌지라 JNI 바인딩의 문제일 가능성이 높습니다. v0.15.2를 사용하시는걸보니 직접 바인딩을 구현하신걸로 보이는데요, 이 부분에서 메모리 관련 오류가 있거나, exception처리가 제대로 안된것이거나, 혹은 Kiwi C API의 버그일수 있어 보입니다. 코드 없이 이 이상으로 정확하게 판단하기는 어려운 점 양해바랍니다.