This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| def verify_draft_tokens( | |
| target_probs: torch.Tensor, # Shape: (K+1, vocab_size) | |
| draft_probs: torch.Tensor, # Shape: (K, vocab_size) | |
| draft_tokens: torch.Tensor, # Shape: (K,) | |
| ) -> tuple[torch.Tensor, int]: | |
| """ | |
| Executes rejection sampling to verify K draft tokens against target probabilities. | |
| Returns a tensor of accepted tokens and the index of the first rejected token. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| env "local" { | |
| src = "file://schema.hcl" | |
| dev = "docker://postgres/15/dev?search_path=public" | |
| migration { | |
| dir = "file://migrations" | |
| } | |
| format { | |
| migrate { | |
| diff = "{{ sql . \" \" }}" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: ray.io/v1 | |
| kind: RayCluster | |
| metadata: | |
| name: ray-cluster-lora | |
| namespace: ml-platform | |
| spec: | |
| rayVersion: '2.35.0' | |
| headGroupSpec: | |
| rayStartParams: | |
| dashboard-host: '0.0.0.0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "context" | |
| "errors" | |
| "fmt" | |
| "net" | |
| "net/http" | |
| "net/url" | |
| "time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE IF NOT EXISTS outbox_events ( | |
| id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY, | |
| aggregate_type VARCHAR(255) NOT NULL, | |
| aggregate_id VARCHAR(255) NOT NULL, | |
| event_type VARCHAR(255) NOT NULL, | |
| payload JSON NOT NULL, | |
| created_at TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP(6), | |
| INDEX idx_created_at (created_at) | |
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Typical goroutine block stack trace found during a pprof capture: | |
| // goroutine 4821 [semacquire, 10 minutes]: | |
| // google.golang.org/grpc/internal/transport.(*controlBuffer).get(0xc0001a23c0, 0x1) | |
| // /go/pkg/mod/google.golang.org/grpc@v1.64.0/internal/transport/controlbuf.go:394 +0x95 | |
| // google.golang.org/grpc/internal/transport.(*http2Server).Write(0xc00021c000, 0xc0001bc300, 0xc0003c2000, 0x0) | |
| // /go/pkg/mod/google.golang.org/grpc@v1.64.0/internal/transport/http2_server.go:882 +0x14c | |
| // google.golang.org/grpc.(*serverStream).SendMsg(0xc0003c2000, {0x18ba620, 0xc00045e4c0}) | |
| // /go/pkg/mod/google.golang.org/grpc@v1.64.0/stream.go:1422 +0x125 | |
| // main.(*ReporterServer).StreamReports(0xc0002ba140, 0xc00028e180, 0xc0003c2000) | |
| // /workspace/main.go:84 +0xbc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "vault_jwt_auth_backend" "github" { | |
| description = "JWT authentication backend for GitHub Actions" | |
| path = "github-actions" | |
| oidc_discovery_url = "https://token.actions.githubusercontent.com" | |
| bound_issuer = "https://token.actions.githubusercontent.com" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <NvInferRuntime.h> | |
| #include <vector> | |
| #include <string> | |
| namespace tensorrt_llm::plugins { | |
| class FusedSwiGLUQuantPlugin : public nvinfer1::IPluginV2DynamicExt { | |
| public: | |
| FusedSwiGLUQuantPlugin(float scale, bool has_dynamic_scale); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // The core math engine for additive Holt-Winters triple exponential smoothing. | |
| // Maintains rolling level, trend, and seasonal components in a memory-efficient manner. | |
| pub struct HoltWinters { | |
| alpha: f64, // Level smoothing parameter (0 < alpha < 1) | |
| beta: f64, // Trend smoothing parameter (0 < beta < 1) | |
| gamma: f64, // Seasonal smoothing parameter (0 < gamma < 1) | |
| period: usize, // Seasonality period length (e.g. 288 steps for 24h at 5m resolution) | |
| level: f64, // Current estimate of the base level | |
| trend: f64, // Current estimate of the trend direction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import torch | |
| from typing import List, Set, Dict | |
| class PhysicalBlockAllocator: | |
| def __init__( | |
| self, | |
| num_blocks: int, | |
| block_size: int, | |
| num_layers: int, | |
| num_heads: int, |