Skip to content

Instantly share code, notes, and snippets.

View kinchungwong's full-sized avatar

Ryan Wong kinchungwong

  • Los Angeles (UTC-0700 on daylight saving time)
View GitHub Profile
[
{
"namespace": "llama_index.agent.openai",
"classes": [
"OpenAIAgent",
"OpenAIAgentWorker",
"OpenAIAssistantAgent"
]
},
{
Grace, would you like to answer Frank's question about CPU-based SIMD programming, especially in relation to AVX-512 and NEON architectures?
--------------------------------------------------------------------------------
Bob:
> > > > > > Grace wrote : > > > > > > > Grace: Certainly, Alice! CPU-based SIMD programming plays a pivotal role when optimizing for performance in functions like OpenCV's remap. With AVX-512, we can process multiple pixels in parallel, dramatically speeding up image transformations. The ability to use gather instructions allows us to quickly pull together non-contiguous data points that are often found in image processing tasks. On ARM architectures, NEON also provides similar capabilities, albeit with a different instruction set. Therefore, when developing the remap function, it is essential to take into account how these SIMD instructions can be utilized effectively. A rigorous evaluation of the memory access patterns should be conducted to ensure that both AVX-512 and NEON can be em
chat_facade_openai_crazy = ChatFacade(client_openai, "gpt-4o-mini", logging_func=chat_log_fn, temperature=1.6, stream=True, stream_logging_func=chat_log_fn)
@kinchungwong
kinchungwong / 0_.py
Last active February 16, 2025 21:46
What happens when we pass 1.6
chat_facade_openai = ChatFacade(client_openai, "gpt-3.5-turbo", logging_func=chat_log_fn)
chat_facade_openai_crazy = ChatFacade(client_openai, "gpt-3.5-turbo", logging_func=chat_log_fn, temperature=1.6, stream=True, stream_logging_func=chat_log_fn)
chat_facade_perplexity = ChatFacade(client_perplexity, "sonar", logging_func=chat_log_fn)
chat_facade_local_ollama = ChatFacade(client_local_ollama, "deepseek-r1:8b", logging_func=chat_log_fn)
session.add_person(alice, chat_facade_openai, common_rewriter, common_response_picker)
session.add_person(bob, chat_facade_openai, common_rewriter, common_response_picker)
session.add_person(charlie, chat_facade_openai, common_rewriter, common_response_picker)
session.add_person(dave, chat_facade_openai_crazy, common_rewriter, common_response_picker)
[{'content': "Let me introduce today's attendees.", 'role': 'system'},
{'content': "Alice is the host for today's meeting.", 'role': 'system'},
{'content': 'Bob specializes in modern day general purpose CPU architectures, '
'especially with out-of-order executions and memory coherency.',
'role': 'system'},
{'content': 'Charlie specializes in multi-core and many-core architectures.',
{'content': 'Dave specializes in memory protocols and components used in '
"today's consumer-grade CPUs.",
{'content': 'Erin specializes in Massively Parallel Computations.',
{'content': 'Frank specializes in CUDA programming. CUDA is a parallel '
[{'content': "Let me introduce today's attendees.", 'role': 'system'},
{'content': '', 'role': 'system'},
{'content': "Alice is the host for today's meeting.", 'role': 'system'},
{'content': 'Bob specializes in modern day general purpose CPU architectures, '
'especially with out-of-order executions and memory coherency.',
'role': 'system'},
{'content': 'Cathy specializes in multi-core and many-core architectures.',
{'content': 'Dean specializes in memory protocols and components used in '
"today's consumer-grade CPUs.",
{'content': 'Erin specializes in Massively Parallel Computations.',
@kinchungwong
kinchungwong / demo_20250214_1906pm.py
Last active February 15, 2025 03:14
demo_20250214_1906pm.py
import os
from openai import OpenAI
import numpy as np
import json
from collections.abc import Sequence
from typing import Any, Optional, Union
import random
from utils import sanitize_python_codestring
class ApiKeyLoader:
@kinchungwong
kinchungwong / demo_20250214_1805pm.py
Created February 15, 2025 02:05
demo_20250214_1805pm.py
import os
from openai import OpenAI
import numpy as np
import json
from collections.abc import Sequence
from typing import Any, Optional, Union
class ApiKeyLoader:
def __init__(self, base_path: str, prefix: str, suffix: str, expanduser: bool = True) -> None:
if expanduser:
@kinchungwong
kinchungwong / demo_20241125_relax.py
Created November 26, 2024 08:52
Simulating a polytope with square bases and triangular side faces.
from abc import ABC as Abstract
from abc import abstractmethod
from collections.abc import Sequence
from enum import Enum
from typing import Any, ForwardRef, overload, Optional, Union
import math
from bisect import bisect_right
import cv2 as cv
@kinchungwong
kinchungwong / Untitled_2024_11_20_image_server_design_question.md
Created November 20, 2024 20:54
Untitled_2024_11_20_image_server_design_question.md

Untitled_2024_11_20_image_server_design_question.md

image storage system

Requirements overview

  • Total number of images stored
    • Near-term future forecasts
  • Statistical distribution of image formats (codecs), image resolutions, and file sizes
  • Statistical distribution of traffic patterns