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
| $uri = 'https://127.0.0.1:16006/CHTCertTokenServer/checkport' | |
| $headers = @{ | |
| 'Accept' = '*/*' | |
| 'Accept-Language' = 'en-US,en;q=0.9,zh-TW;q=0.8,zh;q=0.7' | |
| 'Connection' = 'keep-alive' | |
| 'Content-Length' = '0' | |
| 'Content-Type' = 'text/plain;charset=UTF-8' | |
| 'Origin' = 'https://pki.chinatrust.com' | |
| 'Referer' = 'https://pki.chinatrust.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
| from diffusers import StableDiffusionXLPipeline | |
| pipe = StableDiffusionXLPipeline.from_pretrained( | |
| "stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.bfloat16 | |
| ).to("cuda") | |
| prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" | |
| image = pipe(prompt, num_inference_steps=30).images[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
| import torch | |
| from torch.nn.functional import scaled_dot_product_attention | |
| from torch.nn.attention import SDPBackend | |
| ############################################################################### | |
| # Check for GPU | |
| ############################################################################### | |
| if not torch.cuda.is_available(): | |
| raise SystemExit("CUDA GPU is not available. Please run on a CUDA-enabled device.") |
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
| #!/usr/bin/env python | |
| import os | |
| import sys | |
| import subprocess | |
| import time | |
| from pathlib import Path | |
| # --- Configuration --- |
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
| #!/usr/bin/env python | |
| import os | |
| import sys | |
| import subprocess | |
| import platform | |
| import time | |
| import signal | |
| from pathlib import Path |
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
| #!/usr/bin/env python | |
| import os | |
| import sys | |
| import subprocess | |
| import time | |
| from pathlib import Path | |
| # --- Configuration --- |
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
| PROGRAMS := $(basename $(wildcard *.cpp)) | |
| ROCM_PREFIX := $(HOME)/therock-upstream-output/build/dist/rocm | |
| HIP_CFLAGS := -I$(ROCM_PREFIX)/include | |
| AOTRITON_CFLAGS := -D__HIP_PLATFORM_AMD__ -I$(HOME)/aotriton-output/build/install_dir/include | |
| AOTRITON_LIBS := -L$(HOME)/aotriton-output/build/install_dir/lib -laotriton_v2 -L$(ROCM_PREFIX)/lib -lamdhip64 | |
| %: %.cpp | |
| clang++ $(HIP_CFLAGS) $(AOTRITON_CFLAGS) $< $(AOTRITON_LIBS) -o $@ |
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
| #!/usr/bin/env python | |
| import os | |
| import sys | |
| import subprocess | |
| import time | |
| from pathlib import Path | |
| # --- Configuration --- |
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
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <sys/mman.h> | |
| int main() | |
| { | |
| mprotect((void *)((unsigned long)main & (~0xfff)), 4096, | |
| PROT_EXEC|PROT_WRITE); | |
| { // gcc and clang puts the "0:", "1:" etc labels below at different places | |
| char *p; |
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
| CFLAGS := -Wall -Og | |
| PROGRAMS := fork-exec-memset vfork-exec-memset | |
| .PHONY: all | |
| all: $(PROGRAMS) | |
| .PHONY: test | |
| test: all | |
| ./test-fork-exec-memset |
NewerOlder