윈디하나의 누리사랑방. 이런 저런 얘기

글쓴시간
분류 기술,IT
무료 윈도용 이미지 편집 프로그램 - paint.net

사용자 삽입 이미지

요즘 주로 사용하고 있는 이미지 편집 프로그램이다. 블로그에 AI 로 생성한 그림을 올릴때에도 크롭하거나, 픽셀 한두개 고치는건 이걸 사용해 하고 있다. 포토샵보다야 기능상 떨어지겠지만, 이런 간단한 작업 하기에는 손색 없는 프로그램이다.

공식 홈페이지에서 받는 것 보다, GITHUB 에서 받는걸 추천한다. 여기에는 포터블 버전도 있다. 현재 포터블 버전은 약 127MB 정도 된다.

다운로드 하기: https://github.com/paintdotnet/release/releases

사용자 삽입 이미지

포터블 파일을 다운로드 했으면, 압축을 풀고 paintdotnet.exe 파일을 실행시킨다. 사용 방법은 포토샵과 비슷하다.

공식 홈페이지에 가면 플러그인도 많다. 꽤 오래된 프로그램이기 때문에, 사용자 층도 제법 있다. 앞으로도 자주 애용할것 같다.
글쓴시간
분류 기술,IT/스테이블 디퓨전
Stable Diffusion SDXL FP8 사용시 성능

SDXL 에서는 FP8 를 사용않고 있었다. SDUI 에서도 FP8 이 기본적으로 활성화 되지 않는다. 문득 조금 이상하다는 생각이 들어 찾아봤다.

- 우선 SDUI 에서는 Optimizations 항목에 FP8 관련 설정이 아래와 같이 2개 있다.

① FP8 weight (Use FP8 to store Linear/Conv layers' weight. Require pytorch>=2.1.0.)
◎ Disable ◎ Enable for SDXL ◎ Enable

② Cache FP16 weight for LoRA (Cache fp16 weight when enabling FP8, will increase the quality of LoRA. Use more system ram.)

- ① 을 활성화하면 기본적으로 FP8 을 사용하게 된다. 실제로 해보면 성능 향상(이미지 생성속도)이 없다. 단 메모리는 FP8을 사용하는 만큼 적게 사용한다. FP8을 활성화 하는 경우 일부 LoRA 를 사용할 수 없다. 왜인지는 모르겠지만 오류 발생한다.

- SDXL 메모리 사용량

FP8:  3.80 GB
FP16: 5.23 GB

사용자 삽입 이미지

SDXL FP16


사용자 삽입 이미지

SDXL FP8


주) VAE 는 동일하게 FP32 사용한다.

- ②는 캐시관련된거라 성능에 관련이 없다.

- 결론적으로 써도 성능 향상이 없고, LoRA 호환성만 떨어뜨리기 때문에 사용 안하는 거다. 결과물도 다르다. (단 FP16이 항상 더 좋은 결과를 내주는건 아니다) FLUX.1 dev 는 FP8 을 쓰면 효과가 상당히 좋은데 (이미지 생성속도가 빨라지는데) 유독 SDXL 에서는 효과가 없다.

- 아래는 같은 프롬프트, 같은 파라메터를 사용해서 만든 이미지다. 어떤게 좋다고는 할 수 없지만 왠지 FP16 이 더 빛나 보인다.
사용자 삽입 이미지

FP8 으로 생성한 이미지

사용자 삽입 이미지

FP16으로 생성한 이미지

글쓴시간
분류 기술,IT/스테이블 디퓨전
Stable Diffusion - 노을

바람에 휘날리는 드레스와 노을은 언제나 예쁘다. 생각날때마다 만드는데, 이번에도 한번 올려본다. 해상도가 4000 x 2400 이기 때문에, 4k 화면에서도 잘 보일 것이다.

사용자 삽입 이미지

사용자 삽입 이미지

사용자 삽입 이미지

사용자 삽입 이미지

사용자 삽입 이미지
글쓴시간
분류 문화,취미
DeepSeek R1 로컬에서 실행

딥 시크 R1 을 Python vLLM 을 사용해 로컬에서 실행해 보았다. DeepSeek-R1-Distill-Qwen-1.5B 모델을 사용했는데, 이 모델은 DeepSeek R1 에서 Distill 된 모델중 가장 작은 모델로, 수학 모델이다. 한글을 잘 인식하질 못해서 영어로 질문했다. 인터넷에서 영문 수학 문제를 검색해 문의해보았다.

인터넷을 찾아보면 한글 지원하는 모델도 쉽게 구할 수 있고, 7B 모델만 되어도 한글 잘 인식한다고 한다. 하지만 필자의 사양에서는 못 돌린다. 그래서 INT8 으로 양자화된 모델을 찾고 있기도 하다.

서버 사양은 Ubuntu 22.04, i7-7700K, 32GB, RTX 2060 12G 이다. 아래와 같이 실행했다.

$ mkdir DeepSeek-R1-Distill-Qwen-1.5B
$ cd DeepSeek-R1-Distill-Qwen-1.5B
$ python3 -m venv venv
$ . venv/bin/activate
(venv) $ pip install vllm
(venv) $ vi run.py
from vllm import LLM, SamplingParams

llm = LLM(
    model="deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B",
    dtype="half",
    max_model_len=8_000
)

sampling_params = SamplingParams(
    temperature=0.5,
    max_tokens=8_000
)

prompts = [
    """The day before yesterday I was 25. The next year I will be 28. This is true only one day in a year. What day is my Birthday?"""
]

conversations = [
    [{"role": "user", "content": x}] for x in prompts
]

outputs = llm.chat(conversations, sampling_params=sampling_params)

for output in outputs:
    print(output.outputs[0].text)
(venv) $ python run.py

실행 결과는 아래와 같다. 보기좋게 편집되어있다. 질문은 생일을 맞추는 문제인데, "2일 전에는 25살, 내년에는 28살"일 때 생일을 묻는 문제로, 생일은 12월 31일이다. 정확하게 맞췄다. 약 25초 정도 걸렸다. VRAM 사용량은 약 9.5GB 정도 된다. (nvidia-smi 으로 측정)

(venv) $ python run.py
INFO 02-00 18:51:00 __init__.py:183] Automatically detected platform cuda.
WARNING 02-00 18:51:02 config.py:2368] Casting torch.bfloat16 to torch.float16.
INFO 02-00 18:51:07 config.py:526] This model supports multiple tasks: ...
INFO 02-00 18:51:07 llm_engine.py:232] Initializing a V0 LLM engine (v0.7.1) ...
INFO 02-00 18:51:08 cuda.py:184] Cannot use FlashAttention-2 backend for Volta and Turing GPUs.
INFO 02-00 18:51:08 cuda.py:232] Using XFormers backend.
INFO 02-00 18:51:09 model_runner.py:1111] Starting to load model
deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B...
INFO 02-00 18:51:09 weight_utils.py:251] Using model weights format ['*.safetensors']
INFO 02-00 18:51:10 weight_utils.py:296] No model.safetensors.index.json found in remote.
Loading safetensors checkpoint shards: 0% Completed | 0/1 [00:00<?, ?it/s]
Loading safetensors checkpoint shards: 100% Completed | 1/1 [00:00<00:00, 1.06it/s]
Loading safetensors checkpoint shards: 100% Completed | 1/1 [00:00<00:00, 1.06it/s]

INFO 02-00 18:51:11 model_runner.py:1116] Loading model weights took 3.3460 GB
INFO 02-00 18:51:12 worker.py:266] Memory profiling takes 1.05 seconds
INFO 02-00 18:51:12 worker.py:266] the current vLLM instance can use
total_gpu_memory (11.55GiB) x gpu_memory_utilization (0.90) = 10.40GiB
INFO 02-00 18:51:12 worker.py:266] model weights take 3.35GiB;
non_torch_memory takes 0.04GiB; PyTorch activation peak memory takes 1.41GiB;
the rest of the memory reserved for KV Cache is 5.60GiB.
INFO 02-00 18:51:12 executor_base.py:108] # CUDA blocks: 13097, # CPU blocks: 9362
INFO 02-00 18:51:12 executor_base.py:113] Maximum concurrency for 8000 tokens per request: 26.19x
INFO 02-00 18:51:14 model_runner.py:1435] Capturing cudagraphs for decoding.
This may lead to unexpected consequences if the model is not static.
To run the model in eager mode, set 'enforce_eager=True' or use '--enforce-eager' in the CLI.
If out-of-memory error occurs during cudagraph capture,
consider decreasing `gpu_memory_utilization` or switching to eager mode.
You can also reduce the `max_num_seqs` as needed to decrease memory usage.
Capturing CUDA graph shapes: 100%|█████████████| 35/35 [00:09<00:00, 3.63it/s]
INFO 02-00 18:51:24 model_runner.py:1563] Graph capturing finished in 10 secs, took 0.19 GiB
INFO 02-00 18:51:24 llm_engine.py:429] init engine (profile, create kv cache, warmup model)
took 13.48 seconds
INFO 02-00 18:51:24 chat_utils.py:330] Detected the chat template content format to be 'string'.
You can set `--chat-template-content-format` to override this.
Processed prompts: 100%|███████████████████████
[00:04<00:00, 4.14s/it, est. speed input: 9.66 toks/s, output: 81.16 toks/s]
<think>
To determine the day of the birthday, I start by analyzing the information given.

First, it's stated that the day before yesterday, the person was 25.
This means that yesterday was the birthday day, and today is the day after birthday.

Next, it's mentioned that the next year, the person will be 28.
This implies that the current age is 25 plus 1, which is 26.

Since the person will be 28 in the next year, their birthday must be on December 31st.
This is because the next year's birthday will occur on the same date,
and the age will increase by one year.

Therefore, the birthday is December 31st.
</think>

To determine the day of your birthday, let's analyze the information step by step:

1. **Day Before Yesterday:**
- You were **25** years old the day before yesterday.
- This means **yesterday** was your birthday day.

2. **Next Year:**
- You will be **28** years old in the next year.
- If you are currently 26 years old, your birthday will be on **December 31st** because:
- **Today** is **December 31st**.
- **Tomorrow** will be **January 1st**, and you'll turn **27**.
- **Next Year** (two years from now) you'll be **28** years old.

**Conclusion:**

Your birthday is on **\boxed{December 31st}**.

Think 태그에 보면 사고의 흐름을 볼 수 있다. 이런게 나오긴 한다 정도로 생각하면 된다. 정답은 맞췄지만 논리적 사고를 한다기 보다는 문장의 흐름, 패턴을 검색해 유추한다고 생각한다.
글쓴시간
분류 기술,IT/하드웨어 정보
에이엘테크 Anygate SG801

사용자 삽입 이미지

2008년 5월경 구매한 기가비트 8포트 스위치. 굉장히 오래된 제품이지만 아직까지도 가지고 있다. 잘 작동하기도 하고 말이다.

※ 스펙
칩셋: BCM5398, MNC G4802CG, MNC G4802SG
표준: 10BASE-T/100BASE-TX/1000BASE -T
포트: 10/100/1,000Mbps 8포트, Auto MDI/MDIX
전송방식: Fast store-and-foward
MAC 테이블/학습방법: 8k / 자Self-learning, Auto-Aging
패킷필터링/포워딩: 포트당 14880/148800/1488000pps
전원: DC 9V, 1.2A
크기: 105(W) x 80(D) x 26(H)mm
출시가격: 4.6 만원

케이스가 철제 프레임으로 되어있어서 방열에 좋은 편이다. 생각보다는 작은 크기다.

사용자 삽입 이미지

번들해주는 어댑터가 리니어 방식이라 크고 무겁다. (그만큼 리니어 방식 어댑터가 비싸다. 저렴한게 아니라서 좋다)