Artificial Intelligence 14 min read

How Kuaishou’s YKit AI SDK Powers Mass‑Production of Viral Effects

The article details Kuaishou Y‑tech's YKit AI SDK architecture, its unified interface, modular design, performance optimizations, and three real‑world case studies that illustrate how the SDK enables large‑scale, high‑quality short‑video effects across diverse devices while addressing challenges of effect variety, performance, and cost.

Kuaishou Large Model
Kuaishou Large Model
Kuaishou Large Model
How Kuaishou’s YKit AI SDK Powers Mass‑Production of Viral Effects

On July 5, Kuaishou Y‑tech's AI engineering team presented "Kuaishou Edge AI SDK Framework: Secrets Behind Mass Production of Viral Effects" at the GMTC Global Front‑End Technology Conference, sharing the computer‑vision technologies behind short‑video effects and intelligent creation, the challenges faced, and the engineering solutions.

Background

Kuaishou serves 3.79 billion daily active users and 10 billion monthly active users worldwide. Y‑tech develops AI capabilities such as computer vision, graphics, and AR/VR, which are integrated into all Kuaishou apps to provide intelligent creation tools.

SDK Architecture

The YKit AI SDK is organized into three layers: an AI interface layer , an AI algorithm layer , and an AI low‑level library . The interface layer offers a unified API for initialization, parameter setting, execution, and result retrieval. The algorithm layer contains modular functional components, and the low‑level library includes the KwaiNN inference engine, a self‑developed deep‑learning runtime optimized for various hardware platforms.

YKit runs on iOS, Android, macOS, Windows, and Linux using a single C++ codebase, with hardware‑specific model adaptation and automatic model tiering.

Core Library

The core library provides common modules such as a graphics‑image library (optimized for CPU, Neon, OpenGL, Metal), a module factory for plugin‑style extensions, model management for tiered deployment, data conversion utilities, engine interfaces, and logging/reporting facilities.

Functional Modules

Functional modules expose high‑level AI capabilities (e.g., face keypoints, segmentation, generative effects) through configurable switches and compile‑time options.

Toolchain

The toolchain includes multi‑platform demos, automated Doxygen documentation, a local asset library for rapid debugging, unit tests, and a packaging platform to streamline daily development.

Performance Challenges and Solutions

Key challenges include supporting a large number of AI capabilities, ensuring smooth performance on low‑end devices, and managing package size. YKit addresses these by:

Providing a high‑performance graphics‑image library with over 50 optimized operators.

Implementing a model tiering platform with ten device grades (iOS, Android, Huawei HiAI, Apple CoreML, etc.) that automatically selects the best model for the hardware.

Designing dual processing pipelines (CPU and GPU) with flexible pre‑ and post‑processing and shader‑based GPU acceleration.

Case Studies

Case 1 – GAN‑based Effects : A unified solution reuses eight model structures covering a wide range of MAC operations, with three runtime modes to balance quality on high‑end devices and fluidity on low‑end devices. Over 20 configurable parameters enable rapid effect iteration.

Case 2 – Complex Face Dynamic Effect : Combines face keypoints, 3D reconstruction, rendering, GAN inference, and secondary keypoint calculation. Multi‑threaded execution distributes work across three CPU threads and one GPU thread, dramatically improving performance.

Case 3 – Video Smart Matting : Uses a two‑stage design (CPU pre‑analysis, GPU rendering) with inference caching and tiered cache sizes to achieve superior performance compared to competitors.

Future Outlook

Y‑tech plans to unify server‑side and mobile‑side services, further optimize performance for a broad device spectrum, and continuously improve development efficiency, ultimately delivering better AI services and enhancing user happiness.

mobile developmentperformance optimizationmachine learningcomputer visionARAI SDK
Kuaishou Large Model
Written by

Kuaishou Large Model

Official Kuaishou Account

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.